Clerk Changelog

Python Backend SDK

Category
SDK
Published

We've released a new backend SDK for Python! Here's a quick overview of its capabilities and some resources to help you get started.

We're pleased to announce the release of our server-side Python SDK!

With this launch, Python developers can more easily interface with the Clerk Backend API to manage users, organizations, and sessions.

Asynchronous backend API call with asyncio
import asyncio
from clerk_backend_api import Clerk

async def main():
    sdk = Clerk(
        bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
    )
    res = await sdk.email_addresses.get_async(
        email_address_id="email_address_id_example"
    )
    if res is not None:
        # handle response
        pass

asyncio.run(main())

This release also makes it straightforward to authenticate backend requests in Django, Flask, and other Python web frameworks:

authenticateRequest in action
import os
import httpx
from clerk_backend_api import Clerk
from clerk_backend_api.jwks_helpers import AuthenticateRequestOptions

def is_signed_in(request: httpx.Request):
    sdk = Clerk(bearer_auth=os.getenv('CLERK_SECRET_KEY'))
    request_state = sdk.authenticate_request(
        request,
        AuthenticateRequestOptions(
            authorized_parties=['https://example.com']
        )
    )
    return request_state.is_signed_in

You can pip install the new clerk-backend-api module in any Python 3.8+ application to get started. To help you from there, we've prepared detailed reference documentation in the SDK GitHub repository.

Special thanks to Speakeasy for partnering with us on this SDK release 🎉!

Contributor
Jeff Escalante

Consolidating SSO Connections in the Dashboard

Category
Dashboard
Published

A more intuitive way to add SSO Connections.

We've made an update to the Clerk Dashboard that consolidates "Social Connections" and "Enterprise Connections" into one unified view.

We found through working with our customer's that this distinction was unclear and having to manage these in different places felt unintuitive. Going forward you can simply select the Add connection and choose whether you're attempting to set up a connection for all of your users, or only for users of a specific domain.

Consolidated SSO Connections
Contributor
Laura Beatris

Improve your Web3 application development experience using Clerk and Coinbase

We're excited to announce that Clerk has teamed up with Coinbase to make building Web3 applications easier. As a first step, Clerk released a new API today that allows developers to quickly integrate a customer's Coinbase Wallet with their Clerk user account. In addition, Clerk's embeddable <SignUp/> and <SignIn/> components now support authentication with Coinbase Wallet. Read our documentation to get started.

<SignIn/> with Coinbase Wallet and <UserProfile/> with Coinbase connection:

<SignIn/> with Coinbase Wallet and <UserProfile/> with Coinbase connection

Coinbase Wallet is a user-friendly, self-custodial solution that simplifies onchain transactions. Secured by Passkeys, it allows applications to cover gas fees, enabling users to pay with their Coinbase balance. This streamlined approach makes blockchain interactions more accessible, eliminating complex setups and lowering entry barriers to use products onchain.

Developers building with Clerk can now seamlessly connect user management with Coinbase Wallet functionality. This offers a path to building Web3 applications that prioritize speed of development, security, and ease of use.

We envision a future where identity-based enablement allows for more autonomous, efficient, and secure payment systems. By leveraging Clerk's user management capabilities, developers building on Coinbase Developer Platform are provided with a powerful suite of tools that goes beyond wallet integration – including robust session management, authorization controls, and tools for better customer engagement and retention.

We're eager to see how developers use these tools to more easily create new possibilities in Web3, and we're thrilled to deepen our collaboration with Coinbase Developer Platform to simplify onchain application development.

Contributors
Haris Chaniotakis
Emmanouela Pothitou

More granular control for your users who sign-in via Enterprise Connections.

Administrators now have more control over the behavior of <UserProfile /> when their users authenticate via an Enterprise Connection. This is particularly useful when a B2B customer has strict policies regarding the management of user account information through their IdP (Identity Provider).

Moving forward, additional identifiers will no longer be allowed by default. For existing connections, you are able to adjust this setting in the Advanced tab of each Enterprise Connection in the dashboard.

Disable Additional Identifiers
Contributor
Nicolas Lopes

Introducing sign-up modes, starting with Restricted mode. Take control of who can join your app and prevent unexpected sign-ups.

Whether you're in stealth-mode, running a private beta, or want to only ever manually onboard your customers, we know managing user access can be extremely important.

So allow us to introduce our newest sign-up mode: Restricted

What’s new?

In contrast to the Public sign-up mode that allows for anyone to sign-up to your application, Restricted mode means you have full control over your sign-ups.

Use our Backend APIs or the Clerk Dashboard to manage who gets access. Only users who have received invitations will have the ability sign-up. As mentioned, this can be helpful for use-cases where you want to tightly control who has access to your application whether by inviting folks individually or only supporting previously onboarded B2B customers via Enterprise SSO.

Ready to dive in?

Head to your Clerk Dashboard, or check out how to enable Restricted sign up mode to get started.

Contributors
Konstantinos Pittas
Nikos Papageorgiou

TanStack Start SDK Beta

Category
SDK
Published

Add authentication and authorization to your TanStack Start application in minutes with the new Clerk SDK.

TanStack Start is an exciting new full-stack React framework that provides tons of great functionality like full-document SSR, streaming, server functions, bundling, and more. It's built by the same folks who have contributed some wonderful tools that we all know and love, like TanStack Router and TanStack Query.

We're so excited by it, we've even helped by sponsoring the project.

And today, we're proud to announce @clerk/tanstack-start@beta, a new official SDK that allows developers to add authentication and authorization into their TanStack Start application in matter of minutes.

The SDK comes fully equiped with Clerk's UI components, server utilities, and low level utilities for any of your custom flows.

Use Clerk UI components

Clerk's pre-built UI components give you a beautiful, fully-functional user and organization management experience in minutes.

Here's an example on how simple it is to build a sign-in page using Clerk's <SignIn /> component inside your TanStack Start applications.

app/routes/sign-in.$.tsx
import { SignIn } from '@clerk/tanstack-start'
import { createFileRoute } from '@tanstack/react-router'

export const Route = createFileRoute('/sign-in/$')({
  component: Page,
})

function Page() {
  return <SignIn />
}

Server functions

You can also pair our getAuth() utility function with TanStack Start's server functions to protect your routes.

app/routes/index.tsx
import { createFileRoute, useRouter, redirect } from '@tanstack/react-router'
import { createServerFn } from '@tanstack/start'
import { getAuth } from '@clerk/tanstack-start/server'

const authStateFn = createServerFn('GET', async (_, { request }) => {
  const { userId } = await getAuth(request)

  if (!userId) {
    throw redirect({
      to: '/sign-in/$',
    })
  }

  return { userId }
})

export const Route = createFileRoute('/')({
  component: Home,
  beforeLoad: async () => await authStateFn(),
  loader: async ({ context }) => {
    return { userId: context.userId }
  },
})

function Home() {
  const router = useRouter()
  const state = Route.useLoaderData()

  return <h1>Welcome your user id is {state.userId}!</h1>
}

This is just the beginning. You can learn more on how to get started building TanStack Start applications with Clerk, check out our TanStack Start Quickstart guide.

We're excited to see what you build 🏝️.

Contributor
Vaggelis Yfantis