Skip to content

Conversation

@alexisintech
Copy link
Member

@alexisintech alexisintech commented Sep 12, 2025

🔎 Previews:

⚠️ when #2730 is merged, update session tasks guide

Tip

Just to note that the most used SDKs in order: nextjs, react, express, expo, javascript, js backend

What changed?

  • Adds examples to support most SDKs. Remix is no longer supported so removes those examples. Go and Ruby have small userbases, so skips adding those.
  • Ensures links to /backend-api have {{ target: '_blank' }} following them

FIXES DOCS-11112

Checklist

  • I have clicked on "Files changed" and performed a thorough self-review
  • All existing checks pass

Copy link
Contributor

@SarahSoutoul SarahSoutoul left a comment

Choose a reason for hiding this comment

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

Have left a few comments, but overall, LGTM!

Comment on lines +317 to +319
const clerkResponse = await createClerkClient({
secretKey: process.env.CLERK_SECRET_KEY,
}).users.getUserOauthAccessToken(userId, provider)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could init clerkClient separately for a cleaner example and more in-line with the other examples

Copy link
Member Author

Choose a reason for hiding this comment

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

you need the userId passed from getAuth which relies on the req

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const clerkResponse = await createClerkClient({
secretKey: process.env.CLERK_SECRET_KEY,
}).users.getUserOauthAccessToken(userId, provider)
// Initialize the JS Backend SDK
// This varies depending on the SDK you're using
// https://clerk.com/docs/js-backend/getting-started/quickstart
const clerkClient = await createClerkClient({
secretKey: process.env.CLERK_SECRET_KEY,
})
// Use the JS Backend SDK to get the user's OAuth access token
const clerkResponse = clerkClient.users.getUserOauthAccessToken(userId, provider)

Split it up like this?

@NWylynko
Copy link
Contributor

NWylynko commented Nov 6, 2025

I think to be more in-line with pages like our quickstarts, we should move the overviews to be in the docs/reference/overview.mdx file.

docs/reference/nextjs/overview.mdx -> docs/reference/overview.mdx
docs/reference/android/overview.mdx -> docs/reference/overview.android.mdx
docs/reference/astro/overview.mdx -> docs/reference/overview.astro.mdx
docs/reference/backend/overview.mdx -> docs/reference/overview.js-backend.mdx
docs/reference/chrome-extension/overview.mdx -> docs/reference/overview.chrome-extension.mdx
docs/reference/expo/overview.mdx -> docs/reference/overview.expo.mdx
docs/reference/express/overview.mdx -> docs/reference/overview.expressjs.mdx
docs/reference/fastify/overview.mdx -> docs/reference/overview.fastify.mdx
docs/reference/go/overview.mdx -> docs/reference/overview.go.mdx
docs/reference/ios/overview.mdx -> docs/reference/overview.ios.mdx
docs/reference/javascript/overview.mdx -> docs/reference/overview.js-frontend.mdx
docs/reference/nuxt/overview.mdx -> docs/reference/overview.nuxt.mdx
docs/reference/react/overview.mdx -> docs/reference/overview.react.mdx
docs/reference/react-router/overview.mdx -> docs/reference/overview.react-router.mdx
docs/reference/remix/overview.mdx -> docs/reference/overview.remix.mdx (or bin)
docs/reference/ruby/overview.mdx -> docs/reference/overview.ruby.mdx
docs/reference/tanstack-react-start/overview.mdx -> docs/reference/overview.tanstack-react-start.mdx
docs/reference/vue/overview.mdx -> docs/reference/overview.vue.mdx

But this would have a couple drawbacks:

  • The current folder structure is cleaner having each overview inside the sdk folder.
  • The current /dpcs/reference/overview page would be overridden

const notionData = await notionResponse.json()

// Return the Notion data
return JSON.stringify({ notionData })
Copy link
Contributor

Choose a reason for hiding this comment

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

I think similar to tanstack, react-router has a json() function for returning json objects (https://reactrouter.com/6.30.1/route/loader#returning-responses)

Comment on lines +180 to +186
// Initialize the JS Backend SDK
// This varies depending on the SDK you're using
// https://clerk.com/docs/js-backend/getting-started/quickstart
const clerkClient = createClerkClient({
secretKey: process.env.CLERK_SECRET_KEY,
publishableKey: process.env.CLERK_PUBLISHABLE_KEY,
})
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be initialized outside the handler

Comment on lines +95 to +101
<SignedIn>
Replace the email address with the email address you want to invite. Your Clerk Secret Key is already injected into the code snippet.
</SignedIn>

<SignedOut>
Replace the email address with the email address you want to invite. Update `YOUR_SECRET_KEY` with your Clerk Secret Key which can be found on the [**API keys**](https://dashboard.clerk.com/~/api-keys) page in the Clerk Dashboard.
</SignedOut>
Copy link
Contributor

Choose a reason for hiding this comment

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

I love this use of <SignedIn /> and <SignedOut /> in our docs ❤️

Comment on lines +122 to +132
export async function loader(args: Route.LoaderArgs) {
const { userId } = await getAuth(args)

await clerkClient.users.updateUserMetadata(userId, {
publicMetadata: {
birthday: '1990-01-01',
},
})

return { success: true }
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be a react-router action

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.

6 participants