Skip to content

feat: invites resource — create, list, link, preview, claim - #43

Merged
thinkclay merged 2 commits into
mainfrom
feat/invites-resource
Nov 24, 2026
Merged

thinkclay merged 2 commits into
mainfrom
feat/invites-resource

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

Adds client.invites for Scaffald/SaaS#1398 ("Invite your crew" in the app), over the /v1/invites routes from Scaffald/SaaS#1393 and #1395.

  • create({ contacts, message?, source? }): up to 50 contacts. Email contacts are sent by Scaffald (through NevarMail, with an unsubscribe link). Phone contacts come back ready, with an smsUrl and shareText for the inviter to send from their own phone; Scaffald never texts them.
  • list(): the caller's invites, with invited / joined / onboarded counts.
  • link(): the caller's personal /i/<code> link and share text.
  • preview(code): public; the inviter's first name and avatar only.
  • claim({ code? }): credits a new account to an invite. Without a code, the server matches an email invite sent to the caller's own address.

All responses are bare bodies, as the api returns them. The status type is InviteListStatus, because the organizations resource already exports an InviteStatus.

Tests: src/__tests__/invites.test.ts (msw) covers request shapes and paths. pnpm build passes, and the new types are in dist.

🤖 Generated with Claude Code

…/SaaS#1398)

Worker-to-friend invites over /v1/invites (Scaffald/SaaS#1393, #1395).
Email invites are sent by Scaffald; phone invites come back with an sms:
link and share text for the inviter's own phone. InviteListStatus is named
apart from the organization InviteStatus already exported.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
thinkclay added a commit to Scaffald/SaaS that referenced this pull request Nov 24, 2026
…sheet row (#1398)

- packages/sdk: main moved the SDK pointer to 147f790 (Scaffald/sdk#41,
  #42). Merged that into the invites branch (Scaffald/sdk#43) and point at
  the merge commit ab3eed0, so this keeps both.
- The 'Invite your crew' row in MobileAccountSheet used fontSize: 14 like
  its neighbours, which pushed the drawer over the literal-styling ratchet
  ceiling. It uses fontSize.md (14) from @scaffald/ui/tokens.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@thinkclay
thinkclay merged commit 9373371 into main Nov 24, 2026
@thinkclay
thinkclay deleted the feat/invites-resource branch November 24, 2026 05:48
thinkclay added a commit to Scaffald/SaaS that referenced this pull request Nov 24, 2026
thinkclay added a commit to Scaffald/SaaS that referenced this pull request Nov 24, 2026
…awer and home entry points (#1398) (#1430)

* feat(growth): "Invite your crew" — invite screen, onboarding step, drawer and home entry points (#1398)

/dashboard/invite (ROUTES.DASHBOARD.INVITE):
- Your personal link with Share (OS share sheet on native, navigator.share
  or copy on web) and Copy.
- "Invite people": type or paste emails and phone numbers, one per line or
  comma/semicolon separated, names allowed ("Sam <sam@…>", "Pat 555-…").
  Shows how many it can read before sending; what it can't read stays in
  the box. Sends through the SDK's new invites resource; each result says
  what happened: emailed, a "Text invite" button for phones (opens the
  inviter's own messaging app — Scaffald never texts them), or why it was
  skipped / not sent, including "email invites aren't switched on yet".
- "Your invites": who you invited and whether they joined or set up a
  profile, with the joined count.
- ?from=onboarding retitles it "One last thing" with "Skip for now".

Entry points: onboarding now ends on it for people who ticked "Worker"
(everyone else still goes to the dashboard); an "Invite your crew" footer
row in the desktop drawer and in the phone account sheet; an "Invite your
crew" block on the worker home's second column.

SDK: `client.invites` (Scaffald/sdk#43); the submodule points at that
branch until it merges. scf-core hooks in utils/invites-sdk-hooks.ts.

.radium/scaffald-sdk.md: its examples imported useScaffaldJobsClient from
@scaffald/sdk/react, which doesn't export it (typecheck fails); the 54
existing hook files use ./jobs-sdk-context. Fixed the doc.

Not here: a device contacts picker (expo-contacts needs a native build and
a permission string; its own issue), and the newsletter checkbox (#1396).

Tests: 25 scf-core unit tests for the invites feature (contact parsing,
the screen's states and requests), drawer and dashboard suites green, SDK
msw tests. Browser-checked headless against an api from this branch with
a NevarMail stub: drawer row, home block, link card, a mixed list
(emailed, text button, member skipped, unreadable kept), status list,
onboarding Skip, phone layout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(deps): point the SDK submodule at main after Scaffald/sdk#43 merged (#1398)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant