Tenants
A tenant represents an iOS app that can send push notifications. Each tenant has its own APNs credentials and device registrations.
What This Is
Tenants enable multi-app support. If you have multiple iOS apps or want to separate production from development, create a tenant for each. Each tenant stores its own APNs key and manages its own devices.
When to Use
- You're setting up push notifications for an iOS app
- You have multiple apps that need separate notification channels
- You want separate sandbox and production environments
Prerequisites
Before creating a tenant, you need:
- Bundle ID - Your iOS app's bundle identifier (e.g., com.example.myapp)
- Team ID - Your 10-character Apple Developer Team ID
- APNs Key - A .p8 key file from Apple Developer portal
- Key ID - The 10-character ID for your APNs key
Getting an APNs Key
- Go to Apple Developer Portal → Keys
- Click the + button to create a new key
- Enable "Apple Push Notifications service (APNs)"
- Download the .p8 file (you can only download it once!)
- Note the Key ID shown on the key details page
Creating a Tenant
CLI
mushu tenant create \
--org YOUR_ORG_ID \
--bundle-id com.example.myapp \
--team-id ABCD123456 \
--key-id XYZ1234567 \
--key-file ~/AuthKey_XYZ1234567.p8 API
POST /tenants
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{
"org_id": "YOUR_ORG_ID",
"bundle_id": "com.example.myapp",
"team_id": "ABCD123456",
"key_id": "XYZ1234567",
"private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----",
"use_sandbox": true
} Sandbox vs Production
APNs has two environments:
| Environment | Use For | Flag |
|---|---|---|
| Sandbox | Development builds, TestFlight | --sandbox (default) |
| Production | App Store builds | --production |
Important: Device tokens are different between sandbox and production. A token from a development build won't work on production, and vice versa.
Listing Tenants
mushu tenant list --org YOUR_ORG_ID Setting a Default Tenant
To avoid specifying --tenant on every command:
mushu tenant use TENANT_ID Deleting a Tenant
mushu tenant delete TENANT_ID Warning: Deleting a tenant removes all registered devices and API keys. This cannot be undone.
FAQ
Can I use one APNs key for multiple tenants?
Yes. An APNs key can be used with any app in your Apple Developer team. You can create multiple tenants with different bundle IDs using the same key.
What if my APNs key expires?
APNs keys don't expire. Once created, they work indefinitely unless you revoke them in the Apple Developer portal.
Can I update a tenant's credentials?
Currently, you cannot update credentials. Delete the tenant and create a new one with the updated credentials. Device tokens would need to be re-registered.
How many tenants can I create?
There's no hard limit. Create as many as you need for your apps and environments.
Why Use Mushu Notify?
If you already have APNs code working, you might wonder why switch. Here's what Mushu Notify handles that your ~100 lines of APNs code probably doesn't:
| Feature | Self-Hosted | Mushu Notify |
|---|---|---|
| APNs cert rotation | Manual (annual) | Managed |
| Device token cleanup | Manual | Automatic |
| Delivery analytics | Build it | Built-in |
| Bulk sending | Build it | Built-in |
| Email channel | Separate system | Unified API |
| Rate limiting | Build it | Built-in |
When Self-Hosted Makes Sense
- Low volume, working implementation
- No email requirements
- Strict data locality requirements
When Mushu Makes Sense
- You want push + email in one API
- You need delivery analytics
- You're tired of APNs certificate management
- You're starting a new project
Pricing
- Push notification: $0.005 per device
- Email: $0.005 per recipient
See Pricing for full details and a cost calculator.