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

Closed
5 of 10 tasks
adriantam opened this issue Jul 12, 2024 · 5 comments · Fixed by #427
Closed
5 of 10 tasks

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

adriantam opened this issue Jul 12, 2024 · 5 comments · Fixed by #427
Assignees
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
@kanumalivad
Copy link

Hi @ryanpq Assign this to me.

@mohit07dec
Copy link

@ryanpq @rhamzeh Could you please assign it to me ?

@ewanharris
Copy link
Member

ewanharris commented Oct 4, 2024

I'm going to assign this to @kanumalivad as he commented first.

@mohit07dec if you're still interested in contributing #276 might be a good one to pick up

@siiddhantt
Copy link
Contributor

hi @ewanharris I've linked a PR that should close this issue. Thanks!

@github-project-automation github-project-automation bot moved this from Backlog to Done in SDKs and Tooling Oct 10, 2024
@ewanharris
Copy link
Member

My apologies @kanumalivad, I completely overlooked that we had assigned this to yourself.

If you're still interested in contributing I would recommend #276 as a good one.

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
Archived in project
Development

Successfully merging a pull request may close this issue.

7 participants