Skip to main content
This guide will help you quickly integrate with the Anon API to embed our Link on your website and check job and workflow statuses. The server-side example is written in Node.js, but can be adopted with any language.
1

Generate an API key

Generate and obtain an API key from the Anon Dashboard. See the Authentication guide for detailed instructions.
Only organization admins can generate API keys. Contact your Anon point-of-contact for assistance.
2

Create a link token

Here is the API Reference for this endpoint.Here is
const response = await fetch(`https://${ANON_BASE_URL}/api/v1/link/token`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.ANON_API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      external_id: 'YOUR_EXTERNAL_USER_ID',
      job_id: process.env.ANON_JOB_ID,
      link_config_id: process.env.ANON_LINK_CONFIG_ID
    })
  });

const { link_token } = await response.body()
3

Embed the Link (client-side)

Embed the Link using our SDK.
    import { init, start } from '@anon-dot-com/frontend';

    // Initialize the Anon Link (finds existing link instance)
    await init({
        onEvent: (event) => {
            console.log('Migration event:', event);
        }
    });

    // Start a new link session
    await start({
        linkToken: 'your-link-token-here', // Get this from your server
        onEvent: (event) => {
            console.log('Migration event:', event);
        }
    });
You can refer to this example Github repository with an implementation

Anon Modal Integration Demo

A full example implementation showing how to integrate the Anon Link into a Next.js application.
The user can now interact with the Link within the iframe to start a job. The Link will handle the entire job flow.
4

Configure client-side communication between the SDK and your application

The Link SDK will forward events that happen during a session to the onEvent handler

Modal Communication

Note: All events can also be retrieved via webhooks or the events API.
To listen for modal events, add a message event listener in your parent application. Always check the event source and type:
Example implementation
  onEvent: (event) => {
      // You can also check: event.origin === "https://dashboard.anon.com" for extra security
      if (event.data?.source !== "anon_modal") return;

      const modalEvent = event.data.event;
      if (!modalEvent) return;

      switch (modalEvent.type) {
      case "link.opened":
          // Handle modal opened
          break;
      case "link.closed":
          // Handle user exit
          break;
      case "job.completed":
          // Handle job success
          break;
      case "job.failed":
          // Handle job failure
          break;
      case "workflow.completed":
          // Handle workflow success
          break;
      case "workflow.failed":
          // Handle workflow failure
          break;
      // ... handle other event types as needed
      default:
          // Unknown event
          break;
      }

  };
5

Configure server-side communication using webhooks

You can use some webhook events to be notified when jobs and workflows are complete, as a trigger to poll the Artifacts API.
Your Anon organization can subscribe to webhook events to receive push‑style notifications whenever important events occur during the link session.
1

Create and add an endpoint

Navigate to dashboard.anon.com/webhooks and click + Add endpoint.
2

Define your event source

Enter the HTTPS URL (e.g. https://api.example.com/anon/webhooks) where you want to recieve events.
3

Create and test events

  • Click on Create. You’ll start receiving events immediately.
  • You can create a Svix Play endpoint to test receiving events
  • You can also send example events (svix.ping) through the Testing tab of your endpoint
All webhook events share the same payload format:
{
  "id": "evt_01HX4J1SQ93Y9F6VBQ4JPZW66S",
  "object": "event",
  "created": 2025-06-18T00:50:40.301173,
  "type": "<event_type>",
  "data": {
    "job_run_id": "job_01HX4J3SQ4QZZ9V9JMP8J2V7KZ",
    "workflow_run_id": "workflow_01HX4J3SQ4QZZ9V9JMP8J2V7KZ",
    "object": { /* resource object (see below) */ },
    "error_message": "Only present for *.failed events"
  }
}
6

Use the Artifacts API to retrieve extracted data

The Artifacts API allows you to list and retrieve artifacts associated with workflow runs. Responses from the Artifacts API are returned in a structured JSON format as shown:
    {
    "object": "artifact",
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "created": "2023-11-07T05:31:56Z",
    "name": "<string>",
    "type": "CompanyInfo-EntityType-Screenshot",
    "url": "<string>",
    "size": 123,
    "content_type": "<string>",
    "workflow_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    }
Anon uses a medallion stricture to arrange files into three distinct layers that progressively improve data quality and structure. Bronze files are raw, unprocessed files from source systems. Silver files are standardized, machine-readable (typically JSON) files with enforced schemas.
That’s it! You’re now ready to implement and use Anon!