fix(docs): fix typos in docs
This commit is contained in:
@@ -23,15 +23,15 @@ pnpm install @openpanel/nextjs
|
|||||||
|
|
||||||
### Initialize
|
### Initialize
|
||||||
|
|
||||||
Add `OpenpanelComponent` to your root layout component.
|
Add `OpenPanelComponent` to your root layout component.
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
import { OpenpanelComponent } from '@openpanel/nextjs';
|
import { OpenPanelComponent } from '@openpanel/nextjs';
|
||||||
|
|
||||||
export default RootLayout({ children }) {
|
export default RootLayout({ children }) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<OpenpanelComponent
|
<OpenPanelComponent
|
||||||
clientId="your-client-id"
|
clientId="your-client-id"
|
||||||
trackScreenViews={true}
|
trackScreenViews={true}
|
||||||
// trackAttributes={true}
|
// trackAttributes={true}
|
||||||
@@ -61,7 +61,7 @@ export default RootLayout({ children }) {
|
|||||||
This options needs to be a stringified function and cannot access any variables outside of the function.
|
This options needs to be a stringified function and cannot access any variables outside of the function.
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
<OpenpanelComponent
|
<OpenPanelComponent
|
||||||
clientId="your-client-id"
|
clientId="your-client-id"
|
||||||
filter={`
|
filter={`
|
||||||
function filter(event) {
|
function filter(event) {
|
||||||
@@ -79,7 +79,7 @@ const opFilter = ((event: TrackHandlerPayload) => {
|
|||||||
return event.type === 'track' && event.payload.name === 'my_event';
|
return event.type === 'track' && event.payload.name === 'my_event';
|
||||||
}).toString();
|
}).toString();
|
||||||
|
|
||||||
<OpenpanelComponent
|
<OpenPanelComponent
|
||||||
clientId="your-client-id"
|
clientId="your-client-id"
|
||||||
filter={opFilter}
|
filter={opFilter}
|
||||||
/>
|
/>
|
||||||
@@ -287,10 +287,10 @@ import { createNextRouteHandler } from '@openpanel/nextjs/server';
|
|||||||
export const POST = createNextRouteHandler();
|
export const POST = createNextRouteHandler();
|
||||||
```
|
```
|
||||||
|
|
||||||
Remember to change the `apiUrl` in the `OpenpanelComponent` to your own server.
|
Remember to change the `apiUrl` in the `OpenPanelComponent` to your own server.
|
||||||
|
|
||||||
```tsx {2}
|
```tsx {2}
|
||||||
<OpenpanelComponent
|
<OpenPanelComponent
|
||||||
apiUrl="/api/op"
|
apiUrl="/api/op"
|
||||||
clientId="your-client-id"
|
clientId="your-client-id"
|
||||||
trackScreenViews={true}
|
trackScreenViews={true}
|
||||||
|
|||||||
Reference in New Issue
Block a user