> ## Documentation Index
> Fetch the complete documentation index at: https://docs.migma.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Replit

> Use Migma from Replit apps, agents, and backend jobs.

Use Migma with Replit when an app or agent needs transactional emails, campaign drafts, contacts, webhooks, or delivery logs.

## Recommended setup

<Steps>
  <Step title="Start from Migma handoff">
    In Migma, open **Create**, click **Set up Migma with agent**, and paste the copied `/setup` prompt into Replit Agent.
  </Step>

  <Step title="Approve agent access">
    Use [agent registration](/agent-registration) first. Add `MIGMA_API_KEY` to Replit Secrets only if the agent cannot complete registration.
  </Step>

  <Step title="Add a fallback secret">
    Store `MIGMA_API_KEY` in Replit Secrets.
  </Step>

  <Step title="Choose a surface">
    Use the SDK for Node.js apps, REST for any backend runtime, or CLI for terminal workflows.
  </Step>

  <Step title="Wire backend sends">
    Send from server code, jobs, or trusted functions only.
  </Step>
</Steps>

## Prompt

Use this only if you cannot copy the in-app handoff prompt.

```text theme={null}
Use Migma's /setup workflow for this Replit app.
Use agent registration before asking me for an API key.
Find email triggers and existing templates.
Create or reuse Migma emails.
Store emailId values in backend config.
Add a dry-run test before live sending.
```

## Next

<CardGroup cols={2}>
  <Card title="Agent Handoff" icon="copy" href="/agents/agent-handoff">
    In-app setup prompt and Copy for AI flow.
  </Card>

  <Card title="CLI" icon="terminal" href="/cli">
    Use Migma from terminal workflows.
  </Card>

  <Card title="Webhooks" icon="arrow-path" href="/webhooks">
    Trigger app workflows from Migma events.
  </Card>
</CardGroup>
