Orshot Logo
OrshotDocs
Orshot Embed

Per-User Data

Enable personalized template storage for your users within embed instances

Give each of your users their own private template library within your embedded Orshot instance. Users can save, edit, and manage templates that only they can see.

Benefits

  • Personalized Experience: Each user gets their own template collection separate from workspace templates
  • Data Isolation: User A cannot see or modify User B's templates
  • Seamless Integration: Pass user info via URL parameters—no additional auth required
  • Automatic Management: Users are created automatically on first visit
  • Plan-Based Limits: Control how many users can store templates based on your subscription

How It Works

  1. Enable Per-User Templates in your embed settings
  2. Pass a unique userId parameter when loading the embed
  3. Users see two sections: "My Templates" (personal) and "Workspace Templates" (shared)
  4. Templates saved by users are automatically linked to their account

Query Parameters

ParameterRequiredDescription
userIdYesUnique identifier for the user (from your app)
userNameNoDisplay name for the user
userEmailNoEmail address for the user
metadataNoJSON string with custom user data

Basic Usage

Add the userId parameter to your embed URL:

<iframe
  src="https://orshot.com/embeds/YOUR_EMBED_ID?userId=user_123"
  width="100%"
  height="700"
  allow="clipboard-write; clipboard-read"
/>

With User Details

Include optional user information:

<iframe
  src="https://orshot.com/embeds/YOUR_EMBED_ID?userId=user_123&userName=John%20Doe&userEmail=john@example.com"
  width="100%"
  height="700"
  allow="clipboard-write; clipboard-read"
/>

With Custom Metadata

Pass additional data as a JSON string:

const metadata = JSON.stringify({
  plan: "pro",
  company: "Acme Inc",
  role: "designer",
});

const embedUrl = `https://orshot.com/embeds/YOUR_EMBED_ID?userId=user_123&metadata=${encodeURIComponent(
  metadata
)}`;

Dynamic User Loading (React Example)

function DesignEditor({ user }) {
  const params = new URLSearchParams({
    userId: user.id,
    userName: user.name,
    userEmail: user.email,
  });

  return (
    <iframe
      src={`https://orshot.com/embeds/YOUR_EMBED_ID?${params}`}
      width="100%"
      height="700"
      allow="clipboard-write; clipboard-read"
    />
  );
}

Important Notes

  • The userId must be unique per user in your system
  • User IDs are securely hashed—the original ID is never exposed in the database
  • Without a userId parameter, templates save to the workspace (shared)
  • Users are automatically created on first embed load with a valid userId

Fetching User Templates via API

You can retrieve templates for a specific embed user using the Studio Templates API. Pass both embedId and embedUserId parameters to filter templates.

Get User's Templates

await fetch(
  "https://api.orshot.com/v1/studio/templates/all?embedId=YOUR_EMBED_ID&embedUserId=user_123",
  {
    method: "GET",
    headers: {
      "Content-Type": "application/json",
      Authorization: "Bearer <ORSHOT_API_KEY>",
    },
  }
);

Query Parameters

ParameterTypeRequiredDescription
embedIdStringYes*Your embed instance ID
embedUserIdStringYes*The user ID (same as userId in embed URL)

*Both parameters are required together for user-specific filtering.

Response

Returns only templates belonging to that specific user:

{
  "data": [
    {
      "id": 456,
      "name": "User's Custom Template",
      "embed_user_id": "eui_a1B2c3D4e5F6g7H8",
      "thumbnail_url": "https://storage.orshot.com/thumbnails/template-456.png",
      ...
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 3,
    "totalPages": 1
  }
}

The embed_user_id in the response is a hashed internal ID (format: eui_ + 16 characters). Your original userId is never exposed.

On this page