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

add a section on connecting to Fireproof cloud to getting started #11

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
15 changes: 15 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,21 @@ const docs = await db.allDocs()
const docs = await db.query('hello') // This will return documents with 'world' and 'universe'.
```

## Connect to Fireproof Cloud

Additionally, import the Fireproof cloud package:

```js
import { connect } from "@fireproof/cloud";
```

You can call the `connect` function with a ledger and it will provision a remote UUID for the ledger, and sync the ledger to the remote. It will also log a URL to the console that you can open in a browser to connect to the ledger, as well as try to open the URL in a new tab. Tell us what you think about this workflow!

```typescript
const ledger = await fireproof("my-ledger-name");
const connection = await connect(ledger);
```

And that's it! You've successfully set up Fireproof in your project. Happy coding!

See the [React tutorial](/docs/react-tutorial) for a more complete example, or the [database basics](/docs/database-api/basics) section for more details on how to use Fireproof. Check out the [GitHub Discussions](https://github.com/fireproof-storage/fireproof/discussions) for example apps and more help.
Expand Down