Public sharing and invites

...more docs coming soon

Public sharing

You can share CoValues publicly by setting the owner to a Group, and granting access to "everyone".

const group = Group.create({ owner: me }); group.addMember("everyone", "writer");

This is done in the chat example where anyone can join the chat, and send messages.

You can also add members by Account ID.

Invites

You can grant users access to a CoValue by sending them an invite link.

This is used in the pet example and the todo example.

import { createInviteLink } from "jazz-browser"; createInviteLink(organization, "writer"); // or reader, or admin

It generates a URL that looks like .../invite/[CoValue ID]/[inviteSecret]

In your app, you need to handle this route, and let the user accept the invitation, as done here.

useAcceptInvite({ invitedObjectSchema: PetPost, onAccept: (petPostID) => navigate("/pet/" + petPostID), });

useAcceptInvite is exported from your Jazz app.

const Jazz = createJazzApp(); export const { useAcceptInvite } = Jazz;

...more docs coming soon