Subscribers
Invite customers to follow your project, track how your audience grows, and find a subscriber when you need to.
Subscribers are customers who follow your project on Orvelt. Invite customers who already know you, such as a mailing list or recent buyers who agreed to hear from you, and watch the count grow.
Invite customers
subscribers.invite
import { subscribers } from '@orvelt/business';
const result = await subscribers.invite({
projectId: 'PROJECT_ID',
subscribers: [{ name: 'Alex', email: '[email protected]' }],
});
if (result.error) throw new Error(result.error.message);
const { invited, skipped, invitationAllowance } = result.data;
console.log(`${invited.length} invited, ${skipped.length} skipped`);
console.log(`${invitationAllowance.remaining} invitations left today`);Send 1–100 people per call, each with a name (1–120 characters) and an email (up to 320 characters, trimmed and lowercased). A project can send 100 invitations a day; invitationAllowance reports used, limit, remaining, and resetsAt. Duplicates and people already invited or subscribed are returned in skipped with a reason. An invitation is not a subscription: people become subscribers when they accept.
Inviting needs subscribers invite. New API keys include it, but older read-only keys do not, and subscribers read never grants it.
Track growth
subscribers.count
import { subscribers } from '@orvelt/business';
const result = await subscribers.count({ projectId: 'PROJECT_ID' });
if (result.error) throw new Error(result.error.message);
console.log(result.data.total, result.data.delta);total is today's subscriber count, and delta is the change between the last 30 days and the 30 days before, ready for a dashboard tile.
Find a subscriber
Search the list
Look someone up by email or name with the REST-only list operation and a query, following pagination for the full list. Show subscriber details only to people who need them: this is customer data, not a public feed.