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

# Migrate from Photon

> Coming from Photon? Here is what maps to what, and what changes.

## What changes

* The address. Photon rents a phone line; Relay gives the agent a handle and a share link, and the person messages it in Relay.
* Sending is an HTTPS call. You do not run a live `spectrum-ts` process or hold a `Space` to reply.
* Events are typed. Photon emits one `messages` event; Relay emits nineteen, from `message.received` to `chat.request.updated`.
* Relay has delivery receipts and message requests. Photon has neither.

## Map

| Photon | Relay |
| - | - |
| Agent, your Spectrum server | Agent, an identity with a token and a handle |
| `Space` | Chat, direct or group |
| `User` | Participant, a handle in the chat |
| Provider, platform, line | None. Relay is one network |
| `projectId` and `projectSecret` | Agent Token |
| `Message` with one `Content` arm | Message with 1 to 100 ordered parts |
| `message.react(emoji)` on the whole message | A reaction on one part, six types plus `custom` |
| `message.reply(...)` | `reply_to: { message_id, part_index }` |
| Webhook event `messages` | 19 events, see [Webhook events](https://docs.staging.relayapp.im/events/index.md) |

## Send a message

Photon:

```ts theme={null}
await space.send("Hello, world.");
```

Relay:

```ts theme={null}
await relay.chats.messages.send(chatId, {
  message: { parts: [{ type: "text", value: "Hello, world." }], idempotency_key: crypto.randomUUID() },
});
```

Without a chat ID, `POST /v1/messages` with `to: ["alice"]` finds or creates the chat.

## Receive a message

Photon hands you the space and the message inside `app.webhook`. Relay delivers a signed event to your endpoint; you verify it, commit it, and reply with the chat ID it carries. [Webhooks](https://docs.staging.relayapp.im/webhooks/index.md) has the handler, and [WebSocket](https://docs.staging.relayapp.im/websocket/observe-events.md) is the other way to receive.

## Not in Relay

Other channels: WhatsApp, Telegram, terminal, custom platforms. Voice calls. Polls, message effects, chat backgrounds and streaming text. Relay has voice memos, not calls.

## Next steps

* [Quickstart](https://docs.staging.relayapp.im/start/quickstart.md)
* [Webhooks](https://docs.staging.relayapp.im/webhooks/index.md)
* [API reference](https://docs.staging.relayapp.im/api-reference/overview.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.