Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connect partykit docs update #15

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/connect.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ If you haven't added PartyKit to your app, run the PartyKit CLI:
npx partykit init
```

Finally, connect to the party in your client code:
Finally, connect to the party in your client code. Note that the connect function takes three arguments, the current ledger, the remote ledger name, and the host of your PartyKit server.:

```js
import { useFireproof } from 'use-fireproof'
import { connect } from '@fireproof/partykit'

const { ledger } = useFireproof('my-app-ledger-name')
const connection = connect.partykit(ledger, process.env.PUBLIC_PARTYKIT_HOST!)
const connection = connect(ledger,'', process.env.PUBLIC_PARTYKIT_HOST!)
```

The end result is that your app will sync data with all users connected to the party. Perfect for collaboration, or for sharing data between a user's devices. Take a look at the full instructions in the [PartyKit connector docs](https://www.npmjs.com/package/@fireproof/partykit).
Expand Down