question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compatibility with other js sdk

See original GitHub issue

It is a shame that the different js sdks are not compatibles between each others. I would need to use the different sdks in conjunctions for my custom needs but I need to duplicate a lot of code 😢

For example, to instantiate the client:

  • @auth0/auth0-react
<Auth0Provider
    domain="shopidog.eu.auth0.com"
    clientId="TaAOtuz41cNXYFATTABqt3lYnFIW7mXc"
    redirectUri={window.location.origin}
  >
  • @auth0/auth0-spa-js
const auth0 = await createAuth0Client({
  domain: 'shopidog.eu.auth0.com',
  client_id: 'TaAOtuz41cNXYFATTABqt3lYnFIW7mXc'
});
  • @auth0/auth0-nextjs
initAuth0({
  secret: process.env.SESSION_COOKIE_SECRET,
  issuerBaseURL: process.env.NEXT_PUBLIC_AUTH0_DOMAIN,
  baseURL: process.env.NEXT_PUBLIC_BASE_URL,
  clientID: process.env.NEXT_PUBLIC_AUTH0_CLIENT_ID,
  clientSecret: process.env.AUTH0_CLIENT_SECRET,
  routes: {
    callback:
      process.env.NEXT_PUBLIC_REDIRECT_URI ||
      "http://localhost:3000/api/callback",
    postLogoutRedirect:
      process.env.NEXT_PUBLIC_POST_LOGOUT_REDIRECT_URI ||
      "http://localhost:3000",
  },
  authorizationParams: {
    response_type: "code",
    scope: process.env.NEXT_PUBLIC_AUTH0_SCOPE,
  },
  session: {
    absoluteDuration: parseInt(process.env.SESSION_COOKIE_LIFETIME || "7200"),
  },
});

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
adamjmcgrathcommented, Jul 16, 2021

Hey @ilyaulyanov

When using multiple SDKs in the same environment, on the same domain (e.g. app A uses React SDK, app B uses SPA JS SDK, and an Express server loads either A or B depending on a URL) can they recognize & accept tokens stored in localstorage by either SDK, after logging in?

Yes - auth0-react is just a thin wrapper around a SPA JS client so effectively app A and app B are both using SPA JS

0reactions
gabsncommented, Jul 23, 2021

Yep thanks, fully understand!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Supported environments for the Firebase JavaScript SDK
The Firebase JavaScript SDK is officially supported in the following environments. Important: You still need to include polyfills for environments that ...
Read more >
JavaScript Compatibility - GraalVM
a JavaScript object: the object is queried for a name and a script property, which represent the source name and code, respectively. all...
Read more >
React Native compatibility · Issue #740 · aws/aws-sdk-js - GitHub
I'm not sure of the internal details of React Native, but the SDK should work similarly to any other npm modules you may...
Read more >
Compatibility | Couchbase Docs
The Node.js SDK is fully compatible with Couchbase Capella, our fully-hosted database-as-a-service. To make development easier, the SDK includes the Capella ...
Read more >
Compatibility of the AWS Encryption SDK for JavaScript
The AWS Encryption SDK for JavaScript is designed to be interoperable with other language implementations of the AWS Encryption SDK.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found