create_client_side_token
Generate client-side tokens to authenticate Paddle.js integrations for specific applications or environments, enabling secure payment processing.
Instructions
This tool will create a new client-side token in Paddle.
Client-side tokens are needed to authenticate with Paddle.js. A token is provided when initializing Paddle.js.
When creating a client-side token, provide a descriptive name to help identify its purpose. Usually created for each application or environment that needs to authenticate with Paddle.js.
If successful, the response includes a copy of the new client-side token entity. The returned token field is the client-side token that needs to be provided when initializing Paddle.js. Can be exposed client-side safely. If it starts with:
test_: The token is a test token for a sandbox environment and shouldn't be used in production.
live_: The token is a live token for a production environment. It can be used to test too but Paddle.js checkouts require real cards.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of this client-side token. | |
| description | No | Short description for this client-side token. |
Implementation Reference
- src/functions.ts:982-989 (handler)The handler function that implements the core logic of the 'create_client_side_token' tool by calling paddle.clientTokens.create(params) and handling errors.export const createClientSideToken = async (paddle: Paddle, params: z.infer<typeof Parameters.createClientSideTokenParameters>) => { try { const clientSideToken = await paddle.clientTokens.create(params); return clientSideToken; } catch (error) { return error; } };
- src/tools.ts:985-996 (schema)Tool schema definition including the method name, human-readable name, description prompt, Zod parameters schema reference, and required actions for permissions.{ method: "create_client_side_token", name: "Create a client-side token", description: prompts.createClientSideTokenPrompt, parameters: params.createClientSideTokenParameters, actions: { clientSideTokens: { write: true, create: true, }, }, },
- src/api.ts:90-90 (registration)Registers the createClientSideToken handler function to the tool method constant in the toolMap used by PaddleAPI to dispatch tool calls.[TOOL_METHODS.CREATE_CLIENT_SIDE_TOKEN]: funcs.createClientSideToken,
- src/constants.ts:82-82 (helper)Constant defining the string identifier for the 'create_client_side_token' tool method.CREATE_CLIENT_SIDE_TOKEN: "create_client_side_token",