Skip to content

Add configurable OAuth scopes to Fast42 initialization#51

Merged
FreekBes merged 1 commit into
mainfrom
copilot/initialize-fast42-scopes
Jun 4, 2026
Merged

Add configurable OAuth scopes to Fast42 initialization#51
FreekBes merged 1 commit into
mainfrom
copilot/initialize-fast42-scopes

Conversation

Copilot AI commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Fast42 previously hardcoded OAuth scopes in getAccessToken, preventing scope customization at initialization time. This change adds configurable scopes on initialization and preserves the existing default behavior (public, projects).

  • Scope configuration in constructor

    • Introduced a Fast42Settings object with optional scopes?: string[].
    • Added default scopes: ['public', 'projects'].
    • Kept backward compatibility with the legacy positional constructor signature.
  • Token request scope composition

    • Replaced hardcoded scope=projects%20public with dynamic scope composition from settings.
    • getAccessToken now builds scope as this._scopes.join('%20').
  • Documentation and usage updates

    • Updated constructor docs and examples to use the settings object.
    • Documented the new scopes field and default value.
const api = new Fast42(
  [{ client_id: process.env.FTAPI_UID!, client_secret: process.env.FTAPI_SECRET! }],
  { scopes: ['public', 'projects', 'profile'] }
);

@FreekBes FreekBes self-requested a review June 4, 2026 20:46
@FreekBes FreekBes marked this pull request as ready for review June 4, 2026 20:46
@FreekBes FreekBes merged commit d70b3c0 into main Jun 4, 2026
1 check passed
@FreekBes FreekBes deleted the copilot/initialize-fast42-scopes branch June 4, 2026 21:07
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