rsnext/examples/with-realm-web
2023-01-12 09:36:29 -08:00
..
lib update with-realm-web example (#24241) 2021-04-19 21:53:32 -05:00
pages [Fix] common misspelling errors (#15288) 2020-07-19 04:38:20 +00:00
.env Example with Monogdb ReamlWeb (#14555) 2020-06-30 09:50:44 +00:00
.gitignore Update default gitignore templates (#39051) 2022-07-26 20:08:40 -05:00
package.json examples: Bump SWR to v2.0.0 (#44790) 2023-01-12 09:36:29 -08:00
README.md docs(examples): improve DX while copying command to create new project (#38410) 2022-07-26 21:57:48 -05:00

Realm-Web SDK Example

This example uses Realm-Web SDK to query a realm graphql endpoint using swr.

This example relies on MongoDB Realm for its GraphQL backend.

Deploy your own

Deploy the example using Vercel:

Deploy with Vercel

How to use

Execute create-next-app with npm, Yarn, or pnpm to bootstrap the example:

npx create-next-app --example with-realm-web with-realm-web-app
yarn create next-app --example with-realm-web with-realm-web-app
pnpm create next-app --example with-realm-web with-realm-web-app

Deploy it to the cloud with Vercel (Documentation).

Configuration

To set up your app:

  1. Link a cluster that includes the Atlas sample data sets
  2. Configure permissions for the sample_mflix.movies collection. For this demo, you can assign ready only permissions for all authenticated users.
  3. Generate a collection schema for the sample_mflix.movies collection. Add a root-level "title" field to the schema with the value set to "movie".
  4. Enable anonymous authentication
  5. Once your app is set up, replace the value of NEXT_PUBLIC_REALM_APP_ID in .env file with your App ID