https://github.com/photon-hq/spectrum-ts
Bring agents to any interfaces
https://github.com/photon-hq/spectrum-ts
agent ai photon typescript
Last synced: 26 days ago
JSON representation
Bring agents to any interfaces
- Host: GitHub
- URL: https://github.com/photon-hq/spectrum-ts
- Owner: photon-hq
- License: mit
- Created: 2025-12-20T22:09:31.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2026-04-26T22:34:03.000Z (about 2 months ago)
- Last Synced: 2026-04-27T00:26:04.439Z (about 2 months ago)
- Topics: agent, ai, photon, typescript
- Language: TypeScript
- Homepage: https://photon.codes/spectrum
- Size: 444 KB
- Stars: 84
- Watchers: 0
- Forks: 13
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
- Agents: AGENTS.md
Awesome Lists containing this project
README
Spectrum is a unified messaging SDK for TypeScript. Write your agent logic once and deliver it across every messaging platform — iMessage, WhatsApp, terminal, or your own — through one fully type-safe interface.
## Getting Started
The fastest way to ship is with **Spectrum Cloud** — hosted infrastructure for platforms like iMessage, with credentials ready in minutes.
1. Sign up at **[app.photon.codes](https://app.photon.codes)** to get your project ID and secret.
2. Install the SDK:
```bash
bun add spectrum-ts
```
3. Start your app:
```typescript
import { Spectrum } from "spectrum-ts";
import { imessage } from "spectrum-ts/providers/imessage";
const app = await Spectrum({
projectId: process.env.PROJECT_ID,
projectSecret: process.env.PROJECT_SECRET,
providers: [imessage.config()],
});
for await (const [space, message] of app.messages) {
await space.responding(async () => {
await message.reply("Hello from Spectrum.");
});
}
```
Spectrum also runs fully standalone — you can connect to a local iMessage database, bring your own gRPC endpoints, or build your own platform provider. See the [docs](https://docs.photon.codes) for self-hosted setups.
## Documentation
Visit **[docs.photon.codes](https://docs.photon.codes)** to view the full documentation.
## Platforms
| Platform | Package |
|----------|---------|
| iMessage | `spectrum-ts/providers/imessage` |
| WhatsApp | `spectrum-ts/providers/whatsapp` |
| Terminal | `spectrum-ts/providers/terminal` |
| Custom | `definePlatform` from `spectrum-ts` |
## Issues
Found a bug or have a feature request? Please [open an issue](https://github.com/photon-hq/spectrum-ts/issues) on GitHub. Before filing, search existing issues to avoid duplicates.
## Contributing
Contributions are welcome. Please read [CONTRIBUTING.md](./CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.
## License
[MIT](./LICENSE) © [Photon](https://photon.codes)