### Install Commet Go SDK Source: https://sandbox.commet.co/llms-full.txt Use the go get command to add the Commet SDK to your project dependencies. ```bash go get github.com/commet-labs/commet-go ``` -------------------------------- ### Install @commet/node with bun Source: https://sandbox.commet.co/llms-full.txt Install the Commet Node.js SDK using bun. ```bash bun add @commet/node ``` -------------------------------- ### Run Encore Development Server Source: https://sandbox.commet.co/llms-full.txt Execute this command in your project's root directory to start the Encore development server. Ensure you have Encore installed. ```bash encore run ``` -------------------------------- ### Install Comet SDK with uv Source: https://sandbox.commet.co/llms-full.txt Install the Comet SDK using uv. Ensure uv is installed and configured in your environment. ```bash uv add commet-sdk ``` -------------------------------- ### Configure Billing Routes Source: https://sandbox.commet.co/docs/integrate-with-fastapi Example setup for a billing route in a FastAPI application. ```python from fastapi.responses import RedirectResponse ``` -------------------------------- ### Install @commet/node with npm Source: https://sandbox.commet.co/llms-full.txt Install the Commet Node.js SDK using npm. ```bash npm install @commet/node ``` -------------------------------- ### Install Commet SDK Source: https://sandbox.commet.co/llms-full.txt Commands to create a new Encore application and install the Commet Go package. ```bash encore app create --example=hello-world myapp cd myapp go get github.com/commet-labs/commet-go ``` -------------------------------- ### Install Comet SDK with pip Source: https://sandbox.commet.co/llms-full.txt Install the Comet SDK using pip. This is the most common installation method. ```bash pip install commet-sdk ``` -------------------------------- ### Install Commet SDK with Pip Source: https://sandbox.commet.co/docs/integrate-with-django Use this command to install the Commet SDK using pip. Ensure you have Python and pip installed. ```bash pip install commet-sdk django ``` -------------------------------- ### Start FastAPI Server Source: https://sandbox.commet.co/llms-full.txt Initialize the FastAPI application and start the server. ```python from fastapi import FastAPI from routes.billing import router as billing_router from routes.webhooks import router as webhooks_router app = FastAPI() app.include_router(billing_router) app.include_router(webhooks_router) ``` ```bash uvicorn main:app --port 3000 ``` -------------------------------- ### Trial Pricing Example Source: https://sandbox.commet.co/docs/how-do-trial-periods-work Illustrates a scenario where a customer starts a trial and the price is increased before the trial ends. The customer is charged the new price after the trial concludes. ```javascript Your customer starts a 14-day trial on January 1. On day 10, you raise the price from $99/mo to $129/mo. On day 15, the trial ends. Your customer is charged $129/mo. ``` -------------------------------- ### Install @commet/node with yarn Source: https://sandbox.commet.co/llms-full.txt Install the Commet Node.js SDK using yarn. ```bash yarn add @commet/node ``` -------------------------------- ### Install all Commet skills Source: https://sandbox.commet.co/llms-full.txt Installs the complete suite of Commet billing skills using the CLI. ```bash npx skills add commet-labs/commet-skills ``` -------------------------------- ### Install Commet SDK with FastAPI and Uvicorn Source: https://sandbox.commet.co/docs/integrate-with-fastapi Use this command to install the necessary packages for the Commet SDK, FastAPI, and Uvicorn. Ensure you have Python and pip installed. ```bash pip install commet-sdk fastapi uvicorn ``` -------------------------------- ### Install Billing Best Practices Skill Source: https://sandbox.commet.co/llms-full.txt Install the specific billing best practices skill for AI agents. ```bash npx skills add commet-labs/billing-best-practices ``` -------------------------------- ### Install Commet SDK Source: https://sandbox.commet.co/llms-full.txt Install the required packages using your preferred package manager. ```bash pip install commet-sdk django ``` ```bash uv add commet-sdk django ``` ```bash poetry add commet-sdk django ``` -------------------------------- ### Install Comet SDK with Pip Source: https://sandbox.commet.co/llms-full.txt Use pip to install the Comet SDK and Flask. Ensure you have Python and pip installed. ```bash pip install commet-sdk flask ``` -------------------------------- ### Install @commet/node with pnpm Source: https://sandbox.commet.co/llms-full.txt Install the Commet Node.js SDK using pnpm. ```bash pnpm add @commet/node ``` -------------------------------- ### Full Server Setup with Commet Plugins Source: https://sandbox.commet.co/llms-full.txt Comprehensive server setup using better-auth with Commet, Drizzle adapter, and various plugins like portal, subscriptions, features, usage, and seats. ```typescript import { betterAuth } from "better-auth"; import { drizzleAdapter } from "better-auth/adapters/drizzle"; import { commet as commetPlugin, portal, subscriptions, features, usage, seats, } from "@commet/better-auth"; import { Commet } from "@commet/node"; import { db } from "./db"; import * as schema from "./schema"; const commetClient = new Commet({ apiKey: process.env.COMMET_API_KEY!, environment: process.env.COMMET_ENVIRONMENT as "sandbox" | "production", }); export const auth = betterAuth({ database: drizzleAdapter(db, { provider: "pg", schema }), emailAndPassword: { enabled: true }, plugins: [ commetPlugin({ client: commetClient, createCustomerOnSignUp: true, getCustomerCreateParams: ({ user }) => ({ legalName: user.name, }), use: [ portal({ returnUrl: "/dashboard" }), subscriptions(), features(), usage(), seats(), ], }), ], }); ``` -------------------------------- ### Integration Guides Source: https://sandbox.commet.co/docs/how-does-billing-work Guides for integrating with various platforms and frameworks. ```APIDOC ## Integration Guides This section provides documentation on how to integrate with different technologies: - **/docs/integrate-with-astro** - **/docs/integrate-with-express** - **/docs/integrate-with-hono** - **/docs/integrate-with-bun** - **/docs/integrate-with-python** - **/docs/integrate-with-flask** - **/docs/integrate-with-fastapi** - **/docs/integrate-with-django** - **/docs/integrate-with-java** - **/docs/integrate-with-go** - **/docs/integrate-with-encore** - **/docs/integrate-with-php** - **/docs/integrate-with-laravel** - **/docs/integrate-with-symfony** ``` -------------------------------- ### Install standalone billing skills Source: https://sandbox.commet.co/llms-full.txt Installs universal billing knowledge packages compatible with any stack. ```bash npx skills add commet-labs/billing-best-practices npx skills add commet-labs/pricing-models npx skills add commet-labs/subscription-patterns ``` -------------------------------- ### Install Commet SDK and Flask Source: https://sandbox.commet.co/docs/integrate-with-flask Install the necessary packages for Commet integration and Flask development using pip, uv, or poetry. ```bash pip install commet-sdk flask ``` ```bash uv add commet-sdk flask ``` ```bash poetry add commet-sdk flask ``` -------------------------------- ### Install Commet AI SDK Source: https://sandbox.commet.co/docs/ai-token-billing Install the `@commet/ai-sdk` package to enable automatic AI token tracking when using the Vercel AI SDK. ```bash npm install @commet/ai-sdk ``` -------------------------------- ### Install Commet and Express Source: https://sandbox.commet.co/llms-full.txt Commands to install the required dependencies using various package managers. ```bash pnpm add @commet/node express ``` ```bash npm install @commet/node express ``` ```bash yarn add @commet/node express ``` -------------------------------- ### Install a single Commet skill Source: https://sandbox.commet.co/llms-full.txt Installs a specific skill package from the Commet library. ```bash npx skills add commet-labs/commet-skills --skill commet npx skills add commet-labs/commet-skills --skill ai-billing npx skills add commet-labs/commet-skills --skill billing-behaviors npx skills add commet-labs/commet-skills --skill commet-webhooks npx skills add commet-labs/commet-skills --skill commet-cli ``` -------------------------------- ### Install Commet and Better Auth Packages Source: https://sandbox.commet.co/llms-full.txt Install the necessary packages for both Commet and Better Auth using your preferred package manager. ```bash pnpm add better-auth @commet/better-auth @commet/node ``` ```bash npm install better-auth @commet/better-auth @commet/node ``` ```bash yarn add better-auth @commet/better-auth @commet/node ``` ```bash bun add better-auth @commet/better-auth @commet/node ``` -------------------------------- ### Start Hono Server with Node.js Source: https://sandbox.commet.co/llms-full.txt Set up and start a Hono server using Node.js, routing billing-related requests to the billing handler. ```typescript import { serve } from '@hono/node-server' import { Hono } from 'hono' import billing from './routes/billing' const app = new Hono() app.route('/billing', billing) serve({ fetch: app.fetch, port: 3000 }) ``` -------------------------------- ### Install Commet Skills Source: https://sandbox.commet.co/llms-full.txt Use the npx command to install the full suite of Commet skills or specific knowledge packages. ```bash npx skills add commet-labs/commet-skills ``` ```bash npx skills add commet-labs/billing-best-practices npx skills add commet-labs/pricing-models npx skills add commet-labs/subscription-patterns ``` -------------------------------- ### Simple Upgrade Proration Example Source: https://sandbox.commet.co/llms-full.txt Example demonstrating proration for a customer upgrading their plan mid-month. Assumes a 30-day cycle. ```plaintext Your customer is on Starter at $29/mo, paid on January 1. They upgrade to Pro at $99/mo on January 15 (15 days remaining). Credit for unused Starter days: $29 × (15/30) = $14.50 Charge for remaining Pro days: $99 × (15/30) = $49.50 They pay today: $35.00 Next full invoice: $99 on February 15 ``` -------------------------------- ### Install Commet Node and Hono Source: https://sandbox.commet.co/llms-full.txt Install the necessary packages for Commet Node and Hono using your preferred package manager. ```bash pnpm add @commet/node hono ``` ```bash npm install @commet/node hono ``` ```bash bun add @commet/node hono ``` -------------------------------- ### Install Commet SDK with Poetry Source: https://sandbox.commet.co/docs/integrate-with-django Use this command to install the Commet SDK using Poetry. This is useful for managing Python project dependencies. ```bash poetry add commet-sdk django ``` -------------------------------- ### Promo Code Checkout Calculation Example Source: https://sandbox.commet.co/docs/promo-codes An example showing how a 50% discount code is applied to a $99/mo plan at checkout. ```text Customer enters "LAUNCH50" at checkout for Pro at $99/mo: Subtotal: $99.00 Discount: -$49.50 (LAUNCH50 — 50% off) Total: $49.50 ``` -------------------------------- ### SDK Setup Source: https://sandbox.commet.co/docs/sdk-reference Initialize the Commet SDK with your API key. Obtain your API key from the Commet dashboard. ```APIDOC ## Setup ```javascript import { Commet } from '@commet/node' const commet = new Commet({ apiKey: process.env.COMMET_API_KEY!, }) ``` Get your API key from the [dashboard](https://commet.co/settings/api-keys). ``` -------------------------------- ### Start Server with Billing Routes Source: https://sandbox.commet.co/llms-full.txt Initializes the billing service and sets up HTTP routes for various billing operations including webhooks. Ensure the billing package is correctly imported and initialized. ```go package main import ( "billing" "log" "net/http" ) func main() { billing.Init() defer billing.Client.Close() mux := http.NewServeMux() mux.HandleFunc("POST /billing/subscribe", billing.Subscribe) mux.HandleFunc("GET /billing/subscription/{customerID}", billing.GetSubscription) mux.HandleFunc("GET /billing/features/{feature}/{customerID}", billing.CheckFeature) mux.HandleFunc("POST /billing/usage", billing.TrackUsage) mux.HandleFunc("GET /billing/portal", billing.Portal) mux.HandleFunc("POST /webhooks/commet", billing.HandleWebhook) log.Println("Listening on :3000") log.Fatal(http.ListenAndServe(":3000", mux)) } ``` -------------------------------- ### Example Intro Offer Calculation Source: https://sandbox.commet.co/docs/introductory-offers Illustrates how a 50% discount for 3 months is applied to a subscription, showing the price for each month and the subsequent full price. ```javascript Customer subscribes to Pro at $99/mo with "50% off for 3 months" Month 1: $49.50 Month 2: $49.50 Month 3: $49.50 Month 4: $99.00 (full price) ``` -------------------------------- ### Pricing Change Example: Usage-Based Pricing (Overage) Source: https://sandbox.commet.co/llms-full.txt Explains how changes to per-unit overage prices impact customer billing. Customers are billed at the price set at the start of their current period for usage within that period. ```text You change the overage price from $0.002/call to $0.005/call. Your customer has already used 5,000 extra calls this month. This month's invoice → charged at $0.002 (the price when the period started) Next month's invoice → charged at $0.005 (the new price) ``` -------------------------------- ### Commet SDK - Track Function Example Source: https://sandbox.commet.co/docs/ai-token-billing This example demonstrates how to use the `track()` function within the Commet SDK to log usage data, including AI model details. ```javascript track("model", inputTokens, outputTokens) ``` -------------------------------- ### Commet SDK API Call Example Source: https://sandbox.commet.co/docs/sdk-reference This snippet shows a commented-out example of a POST request to the Commet API for customers, including a note about the expected response status. ```javascript // [Commet SDK] POST https://sandbox.commet.co/api/customers // [Commet SDK] Response status: 200 OK ``` -------------------------------- ### SDK Initialization Source: https://sandbox.commet.co/llms-full.txt How to initialize the Commet client with an API key and configuration options. ```APIDOC ## SDK Initialization ### Description Initialize the Commet client to interact with the API. ### Parameters #### Request Body - **apiKey** (string) - Required - Your API key (starts with ck_) - **environment** ('sandbox' | 'production') - Optional - Target environment (default: 'sandbox') - **debug** (boolean) - Optional - Log requests/responses (default: false) - **timeout** (number) - Optional - Request timeout in ms (default: 30000) - **retries** (number) - Optional - Max retry attempts (default: 3) ### Request Example ```typescript import { Commet } from '@commet/node' const commet = new Commet({ apiKey: process.env.COMMET_API_KEY!, debug: true }) ``` ``` -------------------------------- ### Initialize Commet Client Source: https://sandbox.commet.co/docs/integrate-with-symfony Instantiates the Commet client with API key and environment settings. Use 'live' for production and 'sandbox' for testing. ```php return new Commet( apiKey: $this->apiKey, environment: $this->environment === 'prod' ? 'live' : 'sandbox', ); ``` -------------------------------- ### Initialize Commet Client Source: https://sandbox.commet.co/llms-full.txt Setup the Commet client using secrets stored in the Encore secret manager. ```go package billing import ( commet "github.com/commet-labs/commet-go" ) var secrets struct { CommetAPIKey string CommetWebhookSecret string } var client *commet.Client func initClient() error { var err error client, err = commet.New( secrets.CommetAPIKey, commet.WithEnvironment(commet.Sandbox), ) return err } ``` -------------------------------- ### GET /seats/balances Source: https://sandbox.commet.co/docs/acceptable-use Get all seat balances. ```APIDOC ## GET /seats/balances ### Description Get all seat balances. ### Method GET ``` -------------------------------- ### GET /features/access Source: https://sandbox.commet.co/docs/seat-management Get access information for features. ```APIDOC ## GET /features/access ### Description Get feature access. ### Method GET ### Endpoint /features/access ``` -------------------------------- ### GET /active-subscription Source: https://sandbox.commet.co/docs/integrate-with-symfony Get details of the active subscription. ```APIDOC ## GET /active-subscription ### Description Get details of the active subscription. ### Method GET ### Endpoint /active-subscription ``` -------------------------------- ### GET /seats/balance Source: https://sandbox.commet.co/docs/integrate-with-fastapi Get current seat balance. ```APIDOC ## GET /seats/balance ### Description Get seat balance. ### Method GET ### Endpoint /seats/balance ``` -------------------------------- ### GET /feature-access Source: https://sandbox.commet.co/docs/introductory-offers Get feature access details. ```APIDOC ## GET /feature-access ### Description Get feature access details. ### Method GET ### Endpoint /feature-access ``` -------------------------------- ### Start Express Server Source: https://sandbox.commet.co/llms-full.txt Initialize the Express application and mount the billing routes. ```typescript import express from 'express' import billingRoutes from './routes/billing' const app = express() app.use(express.json()) app.use('/billing', billingRoutes) app.listen(3000) ``` -------------------------------- ### GET /subscriptions/active Source: https://sandbox.commet.co/docs/acceptable-use Get the currently active subscription. ```APIDOC ## GET /subscriptions/active ### Description Get active subscription. ### Method GET ``` -------------------------------- ### Create Customer and Subscription via Commet API Source: https://sandbox.commet.co/docs/integrate-with-symfony Examples showing how to create customers and subscriptions using the Commet API client. ```php $this->commet->customers->create( email: $data['email'], id: $data['customer_id'] ); ``` ```php $subscription = $this->commet->subscriptions->create( customerId: $data['customer_id'] ); ``` -------------------------------- ### GET /seats/balance Source: https://sandbox.commet.co/docs/acceptable-use Get a specific seat balance. ```APIDOC ## GET /seats/balance ### Description Get seat balance. ### Method GET ``` -------------------------------- ### GET /features/access Source: https://sandbox.commet.co/docs/acceptable-use Get access status for features. ```APIDOC ## GET /features/access ### Description Get feature access. ### Method GET ``` -------------------------------- ### Setup Commet CLI Source: https://sandbox.commet.co/llms-full.txt Authenticate with Commet, link your project to an organization, and generate TypeScript types for SDK autocompletion. ```bash commet login # Authenticate in browser commet link # Link project to organization commet pull # Generate TypeScript types ``` -------------------------------- ### GET /features/access Source: https://sandbox.commet.co/docs/integrate-with-laravel Get feature access details for a customer. ```APIDOC ## GET /features/access ### Description Get feature access details. Use action=canUse to check if customer can consume one more unit. ### Method GET ### Endpoint /features/access ### Parameters #### Query Parameters - **action** (string) - Optional - Use 'canUse' to check if customer can consume one more unit. ``` -------------------------------- ### Client Setup with Commet Plugin Source: https://sandbox.commet.co/llms-full.txt Create a better-auth client instance with the Commet plugin and export authentication functions. ```typescript import { createAuthClient } from "better-auth/react"; import { commetClient } from "@commet/better-auth"; export const authClient = createAuthClient({ baseURL: process.env.NEXT_PUBLIC_BETTER_AUTH_URL, plugins: [commetClient()], }); export const { signIn, signUp, signOut, useSession } = authClient; ``` -------------------------------- ### GET /plans/{id} Source: https://sandbox.commet.co/docs/acceptable-use Get details for a specific plan. ```APIDOC ## GET /plans/{id} ### Description Get plan. ### Method GET ``` -------------------------------- ### Initialize Theme Configuration Source: https://sandbox.commet.co/docs/how-do-free-plans-work-without-payment Handles light/dark mode theme switching and system preference detection. ```javascript ((a,b,c,d,e,f,g,h)=>{let i=document.documentElement,j=["light","dark"];function k(b){var c;(Array.isArray(a)?a:[a]).forEach(a=>{let c="class"===a,d=c&&f?e.map(a=>f[a]||a):e;c?(i.classList.remove(...d),i.classList.add(f&&f[b]?f[b]:b)):i.setAttribute(a,b)}),c=b,h&&j.includes(c)&&(i.style.colorScheme=c)}if(d)k(d);else try{let a=localStorage.getItem(b)||c,d=g&&"system"===a?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a;k(d)}catch(a){}})("class","theme","system",null,["light","dark"],null,true,true) ``` -------------------------------- ### Initialize Flask App and Register Blueprints Source: https://sandbox.commet.co/llms-full.txt Sets up the main Flask application, registers the billing and webhooks blueprints, and starts the development server on port 3000. ```python from flask import Flask from routes.billing import billing from routes.webhooks import webhooks_bp app = Flask(__name__) app.register_blueprint(billing, url_prefix="/billing") app.register_blueprint(webhooks_bp) if __name__ == "__main__": app.run(port=3000) ``` -------------------------------- ### Define a GET Route Source: https://sandbox.commet.co/docs/integrate-with-laravel Defines a GET route for '/billing/subscription/{customerId}'. This route is handled by the 'BillingController' class's 'get' method. Ensure the controller and method exist. ```PHP Route::get( '/billing/subscription/{customerId}', [BillingController::class, 'get'] ); ``` -------------------------------- ### Run Flask Application Source: https://sandbox.commet.co/docs/integrate-with-flask Standard entry point for starting the Flask development server. ```python if __name__ == "__main__": app.run(port=3000) ``` -------------------------------- ### GET /api-reference/seats/get-seat-balance Source: https://sandbox.commet.co/docs/trial-periods Get current balance for a specific seat type. ```APIDOC ## GET /api-reference/seats/get-seat-balance ### Description Get current balance for a specific seat type. ``` -------------------------------- ### GET /docs/api-reference/plans/get-plan Source: https://sandbox.commet.co/docs/integrate-with-django Get detailed plan information by code or ID. ```APIDOC ## GET /docs/api-reference/plans/get-plan ### Description Get detailed plan information by code or ID. ### Method GET ### Endpoint /docs/api-reference/plans/get-plan ``` -------------------------------- ### Install Subscription Patterns Skill Source: https://sandbox.commet.co/llms-full.txt Use this command to add the subscription patterns skill to your project. ```bash npx skills add commet-labs/subscription-patterns ``` -------------------------------- ### SDK Configuration and Initialization Source: https://sandbox.commet.co/docs/sdk-reference How to initialize the Commet SDK with your API key and configuration options. ```APIDOC ## SDK Initialization ### Description Initialize the Commet client to interact with the API. ### Parameters #### Options - **apiKey** (string) - Required - Your API key (starts with ck_) - **environment** ('sandbox' | 'production') - Optional - Target environment (default: 'sandbox') - **debug** (boolean) - Optional - Log requests/responses (default: false) - **timeout** (number) - Optional - Request timeout in ms (default: 30000) - **retries** (number) - Optional - Max retry attempts (default: 3) ### Request Example ```javascript import { Commet } from '@commet/node' const commet = new Commet({ apiKey: process.env.COMMET_API_KEY!, environment: 'sandbox', debug: true }) ``` ``` -------------------------------- ### GET /seats/balance/{id} Source: https://sandbox.commet.co/docs/integrate-with-flask Get seat balance for a specific entity. ```APIDOC ## GET /seats/balance/{id} ### Description Get seat balance for a specific entity. ### Method GET ### Endpoint /seats/balance/{id} ``` -------------------------------- ### Implement Subscription Controller Source: https://sandbox.commet.co/docs/integrate-with-laravel Create a controller to handle customer creation and subscription requests. ```php validate([ 'email' => 'required|email', 'customer_id' => 'required|string', ]); $this->commet->customers->create( email: $request->input('email'), id: $request->input('customer_id'), ); $subscription = $this->commet->subscriptions->create( customerId: $request->input('customer_id'), planCode: 'pro', ); } ``` -------------------------------- ### GET /api/plans/{planCode} Source: https://sandbox.commet.co/docs/what-happens-when-you-change-your-prices Get detailed plan information by code or ID. ```APIDOC ## GET /api/plans/{planCode} ### Description Get detailed plan information by code or ID. ### Method GET ### Endpoint /api/plans/{planCode} ### Parameters #### Path Parameters - **planCode** (string) - Required - The code or ID of the plan. ### Response #### Success Response (200) - **id** (string) - The plan's unique identifier. - **code** (string) - The plan's code. - **name** (string) - The name of the plan. - **description** (string) - A description of the plan. - **price** (number) - The price of the plan. - **features** (array) - An array of features included in the plan. ``` -------------------------------- ### Get Seat Balance Source: https://sandbox.commet.co/docs/merchant-of-record Get current balance for a specific seat type. ```APIDOC ## GET /docs/api-reference/seats/get-seat-balance ### Description Get current balance for a specific seat type. ``` -------------------------------- ### Install Pricing Models Skill Source: https://sandbox.commet.co/llms-full.txt Use this command to add the pricing models skill to your project. ```bash npx skills add commet-labs/pricing-models ``` -------------------------------- ### GET /api/seats/balances Source: https://sandbox.commet.co/docs/what-happens-when-you-change-your-prices Get the current balance for all seat types in a customer's subscription. ```APIDOC ## GET /api/seats/balances ### Description Get the current balance for all seat types in a customer's subscription. ### Method GET ### Endpoint /api/seats/balances ### Parameters #### Query Parameters - **customerId** (string) - Required - The ID of the customer. ### Response #### Success Response (200) - **balances** (object) - An object containing the balance for each seat type. - **seatType1** (object) - Balance details for seat type 1. - **used** (integer) - The number of seats used. - **limit** (integer) - The total number of seats allowed. - **seatType2** (object) - Balance details for seat type 2. - **used** (integer) - The number of seats used. - **limit** (integer) - The total number of seats allowed. ``` -------------------------------- ### Configure Commet Environment Source: https://sandbox.commet.co/llms-full.txt Set the API key and initialize the Commet client. ```text COMMET_API_KEY=ck_sandbox_xxx ``` ```php