Skip to main content

Overview

Canvas apps support built-in authentication powered by Clerk. When you enable auth, your users can sign up and sign in via Google, GitHub, or email/password — with no extra libraries or configuration on your part. The auth SDK is auto-injected into your app at runtime. You get a window.MixpeekAuth object with methods to check sign-in state, show modals, and access user profiles.

Enabling Auth

Enable Clerk authentication by updating your app’s auth_config:
Setting mode to "clerk" automatically:
  • Injects window.__MIXPEEK__ with Clerk configuration
  • Loads the /_auth/sdk.js script into your app
  • Enforces authentication on all /api proxy requests
You do not need to install or import any auth libraries. The canvas runtime handles everything.

Using MixpeekAuth in Your App

The SDK exposes window.MixpeekAuth with the following API:

React Example


Auth Endpoints

The canvas runtime exposes three auth endpoints on your app’s domain:
Use /_auth/me from your frontend to verify auth state on page load without relying solely on the client-side SDK.

API Access and Billing

All /api requests are authenticated with the app owner’s API key — your end-users never need their own Mixpeek credentials.
  • Usage is billed to the organization that owns the Canvas app
  • The /api proxy supports all Mixpeek API methods: retrievers, collections, documents, and marketplace
  • End-users interact with your app; your API key handles the backend calls transparently
Because all API usage is billed to your organization, monitor your usage in Studio to avoid unexpected costs from high-traffic apps.

User Storage

When users sign up through your app, their metadata (email, name, avatar) is stored automatically. Each app maintains its own user list, scoped independently from other apps. Access user data via the /_auth/users endpoint:
Response:

Auth Providers

By default, Clerk authentication supports:
  • Google — OAuth sign-in
  • GitHub — OAuth sign-in
  • Email / password — standard credentials
Configure allowed providers via auth_config.clerk_allowed_providers:
Omit clerk_allowed_providers to enable all default providers (Google, GitHub, and email/password).