Skip to content

Conversation

@krzysztof-maziarka-bc
Copy link

@krzysztof-maziarka-bc krzysztof-maziarka-bc commented Jan 28, 2026

Jira: PAPI-3173

What changed?

  • Introduce private tokens for server-to-server GraphQL Storefront API use and document create/revoke REST endpoints.
  • Deprecate storefront tokens for server-to-server: new storefront tokens will no longer work statelessly in server-to-server contexts after a future date; recommend private tokens for new s2s integrations.
  • Stop recommending storefront tokens for s2s: direct server-to-server and headless/server-side flows to private tokens (and customer access tokens where needed).
  • Clarify storefront tokens as browser-only (CORS via allowed_cors_origins) and allow customer access tokens to be used with either a storefront or private token.

Release notes draft

  • Private tokens are now available for authenticating server-to-server requests to the GraphQL Storefront API. Use them for backend and headless integrations instead of storefront tokens.
  • Storefront tokens remain for browser-based storefronts; new storefront tokens will stop working for server-to-server after a future date, so use private tokens for new server-to-server integrations. Learn more.

Anything else?

Related to: https://github.com/bigcommerce/developer-center/pull/1346

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request introduces private tokens for server-to-server integrations with the GraphQL Storefront API and deprecates the use of storefront tokens in server-to-server contexts. The changes include new API endpoints, comprehensive documentation updates, and clear migration guidance for developers.

Changes:

  • Added a new /storefront/api-token-private endpoint with POST and DELETE operations for creating and revoking private tokens
  • Added deprecation notices across API reference and documentation indicating that storefront tokens will no longer be usable statelessly in server-to-server contexts after a future deprecation date
  • Updated all relevant documentation to recommend private tokens for server-to-server use cases while maintaining storefront tokens for browser-based applications

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
reference/storefront_tokens.v3.yml Added private token endpoint definitions (create/revoke), updated descriptions to clarify token types, and added deprecation notice for storefront tokens in S2S contexts
docs/storefront/headless/customers.mdx Updated to recommend private tokens with customer access tokens for headless/server-side code
docs/storefront/headless/channels.mdx Clarified token usage patterns: private tokens for S2S, customer impersonation for S2S with customer data, storefront tokens for browsers
docs/storefront/graphql/index.mdx Added deprecation warning for storefront tokens in S2S contexts and updated guidance to recommend private tokens
docs/start/authentication/graphql-storefront.mdx Added comprehensive private tokens section with creation examples, security guidance, and updated all S2S recommendations to use private tokens

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


- **Server-to-server only:** The API rejects private token-authenticated requests that originate from web browsers
- **Always stateless:** No session or cookie validation required
- **Required for server-to-server:** Private tokens are required for all server-to-server integrations. Storefront tokens cannot be used statelessly in server-to-server contexts.
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The statement "Private tokens are required for all server-to-server integrations. Storefront tokens cannot be used statelessly in server-to-server contexts" is inconsistent with the deprecation notice, which states that existing storefront tokens created before the deprecation date will continue to work in server-to-server contexts. This should be rephrased to indicate that private tokens will be required going forward, or that they are required for new integrations, rather than stating it as an absolute present requirement.

Suggested change
- **Required for server-to-server:** Private tokens are required for all server-to-server integrations. Storefront tokens cannot be used statelessly in server-to-server contexts.
- **Required for new server-to-server integrations:** Private tokens are required for new and future server-to-server integrations. Existing storefront tokens created before the deprecation date will continue to work in server-to-server contexts as described in the deprecation notice above.

Copilot uses AI. Check for mistakes.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we do not want to encourage users to use strf tokens in any way.

In other words: our current users will be asked to migrate from strf token to private token (in terms of the s2s ctx).

krzysztof-maziarka-bc and others added 4 commits January 28, 2026 15:03
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…on descriptions and remove private token revocation endpoint
…-token-introduction' into PAPI-3173_strf-stateless-private-token-introduction
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +322 to +329
```json filename="Example response: Create a private token" showLineNumbers copy
{
"token": "...eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9...",
"meta": {
// ...
}
}
```
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The response example structure is inconsistent with the OpenAPI schema definition and the customer impersonation token response format shown elsewhere in this file. According to the Token_Full schema in the OpenAPI specification, the token should be nested under a data property. The response should be structured as: { "data": { "token": "..." }, "meta": {} } instead of { "token": "...", "meta": {} }. This same structure is used in the customer impersonation token response example at lines 382-388.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants