Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NodeJS] README.md missing import in Client Credentials example #392

Open
5 of 10 tasks
adriantam opened this issue Jul 12, 2024 · 0 comments
Open
5 of 10 tasks

[NodeJS] README.md missing import in Client Credentials example #392

adriantam opened this issue Jul 12, 2024 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers hacktoberfest js-sdk Affects the JavaScript SDK

Comments

@adriantam
Copy link
Member

Checklist

  • I have looked into the README and have not found a suitable solution or answer.
  • I have looked into the documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Slack Community and have not found a suitable solution or answer.
  • I agree to the terms within the OpenFGA Code of Conduct.

Description

Example listed in https://github.com/openfga/js-sdk/blob/main/README.md#client-credentials did not work as is because CredentialsMethod is not imported.

Instead, it should read

const { OpenFgaClient, CredentialsMethod } = require('@openfga/sdk'); // OR import { OpenFgaClient } from '@openfga/sdk';

const fgaClient = new OpenFgaClient({
  apiUrl: process.env.FGA_API_URL, // required
  storeId: process.env.FGA_STORE_ID, // not needed when calling `CreateStore` or `ListStores`
  authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request
  credentials: {
    method: CredentialsMethod.ClientCredentials,
    config: {
      apiTokenIssuer: process.env.FGA_API_TOKEN_ISSUER,
      apiAudience: process.env.FGA_API_AUDIENCE,
      clientId: process.env.FGA_CLIENT_ID,
      clientSecret: process.env.FGA_CLIENT_SECRET,
    }
  }
});

Expectation

See above

Reproduction

See above

SDK Checklist

  • JS SDK
  • Go SDK
  • .NET SDK
  • Python SDK
  • Java SDK

OpenFGA SDK version

0.6.1

OpenFGA version

N/A

SDK Configuration

N/A

Logs

No response

References

No response

@adriantam adriantam added the bug Something isn't working label Jul 12, 2024
@rhamzeh rhamzeh added good first issue Good for newcomers js-sdk Affects the JavaScript SDK labels Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers hacktoberfest js-sdk Affects the JavaScript SDK
Projects
Status: Backlog
Development

No branches or pull requests

3 participants