Changelog January 27, 2023

Category
Company
Published

Refactored API keys, Gatsby V5, Dynamic documentation, and migration support for Redwood self-hosted Auth.

Refactored API keys

We've refactored our API keys to a more familiar format:

  • Publishable key (prefixed with pk_test_ or pk_live_)
  • Secret key (prefixed with sk_test_ or sk_live_)

Quick copy

With this upgrade, we introduced a quick copy in our dashboard for each of our SDKs allowing you to move faster than ever.

What about legacy keys?

Legacy keys are still available in the dashboard and can continue to be used. Once ready to upgrade, you will need to replace all the keys simultaneously, as you cannot mix the legacy keys with the new ones.

But why?

Learn more about the motivation behind our new keys.

Documentation improvements

Developer experience is huge for us here at Clerk, and with that, we want to make it easy to get started and easier to find what you are looking for.

Dynamic documentation

Last week we introduced new environment-driven examples, allowing us to insert your keys into our docs. This is only in our get-started sections, but we want to add it to more places in the near future.

Search improvements

We spent some time improving the search and results that were returned, this has been high on our list this month, and we think the improvement already shows.

t3-turbo-and-clerk

We launched a new starter repo called t3-turbo-and-clerk.

For the launch, we collaborated with t3's creator, Theo Browne, to show off the simplicity of the solution. Check it out:

Gatsby V5

We updated our Gatsby plugin to support Gatsby V5. You can now access the user's authentication state on the client or the server. Below are examples of SSR and API routes:

SSR

/pages/ssr.tsx
import * as React from 'react';
import { GetServerData } from 'gatsby';
import { withServerAuth } from 'gatsby-plugin-clerk/ssr';

export const getServerData: GetServerData<any> = withServerAuth(
  async props => {
    return { props: { data: '1', auth: props.auth } };
  },
  { loadUser: true },
);

function SSRPage({ serverData }: any) {
  return (
    <main>
      <h1>SSR Page with Clerk</h1>
      <pre>{JSON.stringify(serverData, null, 2)}</pre>
    </main>
  );
}

export default SSRPage;

API Routes

/api/hello.ts
import { clerkClient, withAuth } from 'gatsby-plugin-clerk/api'

interface ContactBody {
  message: string
}

const handler = withAuth(async (req, res) => {
  const users = await clerkClient.users.getUserList()
  res.send({ title: `We have ${users.length} users`, message: req.body.message, auth: req.auth })
})

export default handler

Redwood dbAuth migration Support

We now support migrating users and their hashed passwords (using pbkdf2_sha1) from RedwoodJS dbAuth to Clerk using our API.

Migrating for another tool? Contact support to let us know if you need us to add another hashing algorithm.

Node 12 is no longer supported

We have dropped support for Node 12 and will be only supporting Node 14 or higher.

Community Highlights

Brazilian translation

A massive shoutout to Darlan for his first contribution to Clerk by adding a Brazilian translation to our Clerk components.