list_client_side_tokens
Retrieve client-side authentication tokens for Paddle.js integration, with filtering by status and paginated results management.
Instructions
This tool will list client-side tokens in Paddle.
Client-side tokens are needed to authenticate with Paddle.js. A token is provided when initializing Paddle.js.
Use the maximum perPage by default (200) to ensure comprehensive results. Filter client-side tokens by status as needed. Results are paginated - use the 'after' parameter with the last ID from previous results to get the next page. Sort and order results using the orderBy parameter.
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.
Client-side tokens have a status:
active: Client-side token can be used to authenticate with Paddle.js.
revoked: Client-side token has been revoked and can no longer be used to authenticate with Paddle.js.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| after | No | Return entities after the specified Paddle ID when working with paginated endpoints. | |
| orderBy | No | Order returned entities by the specified field and direction. | |
| perPage | No | Set how many entities are returned per page. Returns the maximum number of results if a number greater than the maximum is requested. | |
| status | No | Return entities that match the specified status. Use a comma-separated list to specify multiple status values. |
Implementation Reference
- src/functions.ts:1011-1020 (handler)The core handler function that executes the tool logic: lists client-side tokens using the Paddle SDK, fetches the first page of results, computes pagination metadata using the shared paginationData helper, and returns the paginated list.export const listClientSideTokens = async (paddle: Paddle, params: z.infer<typeof Parameters.listClientSideTokensParameters>) => { try { const collection = paddle.clientTokens.list(params); const clientSideTokens = await collection.next(); const pagination = paginationData(collection); return { pagination, clientSideTokens }; } catch (error) { return error; } };
- src/tools.ts:974-984 (schema)Tool schema definition: specifies the method name, human-readable name, description prompt, Zod input parameters schema (from parameters.js), and required API actions (read/list on clientSideTokens).method: "list_client_side_tokens", name: "List client-side tokens", description: prompts.listClientSideTokensPrompt, parameters: params.listClientSideTokensParameters, actions: { clientSideTokens: { read: true, list: true, }, }, },
- src/api.ts:89-89 (registration)Registers the tool handler (funcs.listClientSideTokens) under the LIST_CLIENT_SIDE_TOKENS method key in the central toolMap used by PaddleAPI.run() to dispatch tool calls.[TOOL_METHODS.LIST_CLIENT_SIDE_TOKENS]: funcs.listClientSideTokens,
- src/constants.ts:81-81 (registration)Defines the string constant for the tool method name, used in toolMap keys, tool definitions, etc.LIST_CLIENT_SIDE_TOKENS: "list_client_side_tokens",