npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@godaddy/react

v1.0.13

Published

The `createCheckoutSession` function creates a new checkout session with GoDaddy's commerce API.

Readme

Checkout Package

Checkout Session

Creating a Checkout Session

The createCheckoutSession function creates a new checkout session with GoDaddy's commerce API.

import { createCheckoutSession } from "@godaddy/react";

const session = await createCheckoutSession(input, options);

Checkout Session Input Configuration

The first parameter accepts all checkout session configuration options from the GraphQL schema:

Required Parameters

  • channelId (string): The ID of the sales channel that originated this session
  • storeId (string): The ID of the store this checkout session belongs to
  • draftOrderId (string): The ID of the draft order
  • returnUrl (string): URL to redirect to when user cancels checkout
  • successUrl (string): URL to redirect to after successful checkout

Optional Parameters

  • customerId (string): Customer ID for the checkout session
  • storeName (string): The name of the store this checkout session belongs to
  • url (string): Custom URL for the checkout session
  • environment (enum): Environment - ote, prod
  • expiresAt (DateTime): When the session expires
  • enableBillingAddressCollection (boolean): Enable billing address collection
  • enableLocalPickup (boolean): Enable local pickup option
  • enableNotesCollection (boolean): Enable order notes collection
  • enablePaymentMethodCollection (boolean): Enable payment method collection
  • enablePhoneCollection (boolean): Enable phone number collection
  • enablePromotionCodes (boolean): Enable promotion/discount codes
  • enableShippingAddressCollection (boolean): Enable shipping address collection
  • enableSurcharge (boolean): Enable surcharge fees
  • enableTaxCollection (boolean): Enable tax collection
  • enableTips (boolean): Enable tip/gratuity options
  • enabledLocales ([String!]): List of enabled locales
  • enabledPaymentProviders ([String!]): List of enabled payment providers
  • locations ([CheckoutSessionLocationInput!]): Available pickup locations
  • operatingHours (CheckoutSessionOperatingHoursMapInput): Store operating hours configuration
  • paymentMethods (CheckoutSessionPaymentMethodsInput): Payment method configurations

Checkout Session Options

The CheckoutSessionOptions interface allows you to configure authentication and other settings:

interface CheckoutSessionOptions {
	auth?: {
		clientId: string;
		clientSecret: string;
	};
}

Authentication Options

  • auth.clientId (string): OAuth2 client ID for GoDaddy API authentication
  • auth.clientSecret (string): OAuth2 client secret for GoDaddy API authentication

When provided, these credentials will be used to obtain an access token for API requests. If not provided, the function will use empty strings which may result in authentication failures.

Environment Support

The checkout session supports multiple environments through the input parameter:

  • prod: Production environment (https://api.godaddy.com)
  • ote: OTE environment (https://api.ote-godaddy.com)

API Scopes

The checkout session automatically requests the following OAuth2 scopes:

  • commerce.product:read
  • commerce.order:read
  • commerce.order:update
  • location.address-verification:execute

Codegen

For now the schema will be downloaded from the order schema.

pnpm run codegen

Todos

  • [ ] Add tests
  • [ ] Refactor some external libs
    • [ ] graphql-request
    • [ ] arktype - try valibot instead for bundle size sad to lose devx but can be mmuch smaller
    • [ ] floating ui dependencies