Skip to content

Commit

Permalink
docs: user junobuild/core-peer for next (#65)
Browse files Browse the repository at this point in the history
Signed-off-by: David Dal Busco <[email protected]>
  • Loading branch information
peterpeterparker authored Nov 9, 2023
1 parent 2c9a66d commit 01e312b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion docs/guides/astro.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ Add an `insert` function to persist a document.
import { initJuno, setDoc } from "@junobuild/core";
// Initialize Juno
// TODO: Replace 'satelliteId' with your actual satellite ID
document.addEventListener(
"DOMContentLoaded",
async () => {
await initJuno({
satelliteId: "nkzsw-gyaaa-aaaal-ada3a-cai",
satelliteId: "aaaaa-bbbbb-ccccc-ddddd-cai",
});
},
{ once: true }
Expand Down
10 changes: 5 additions & 5 deletions docs/guides/nextjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ npx create-next-app@latest myjunoapp

### 3. Install the Juno SDK core library

Use `@junobuild/core` client library which provides a convenient interface for working with Juno from a Next.js app.
Use `@junobuild/core-peer` client library which provides a convenient interface for working with Juno from a Next.js app.

Navigate to the Next.js app and install `@junobuild/core`.
Navigate to the Next.js app and install `@junobuild/core-peer`.

```bash
cd myjunoapp && npm i @junobuild/core
cd myjunoapp && npm i @junobuild/core-peer
```

### 4. Insert data from your app
Expand All @@ -57,7 +57,7 @@ Add an `insert` function to persist a document.
"use client";

import { useEffect, useState } from "react";
import { type Doc, initJuno, setDoc } from "@junobuild/core";
import { type Doc, initJuno, setDoc } from "@junobuild/core-peer";

type Record = {
hello: string;
Expand All @@ -70,7 +70,7 @@ export default function Home() {
useEffect(() => {
(async () =>
await initJuno({
satelliteId: "wjar4-kiaaa-aaaal-ab4va-cai",
satelliteId: "aaaaa-bbbbb-ccccc-ddddd-cai",
}))();
}, []);

Expand Down

0 comments on commit 01e312b

Please sign in to comment.