Skip to content
Closed
Show file tree
Hide file tree
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
42 changes: 29 additions & 13 deletions docs/src/content/en/_meta.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MetaRecord } from "nextra";

const meta: MetaRecord = {
export default {
"getting-started-separator": {
type: "separator",
title: "Getting Started",
Expand All @@ -12,21 +12,21 @@ const meta: MetaRecord = {
layout: "default",
},
},
installation: {
title: "Installation",
"why-event-tracker": {
title: "Why Event Tracker?",
theme: {
toc: true,
layout: "default",
},
},
"quick-start": {
title: "Quick Start",
installation: {
title: "Installation",
theme: {
toc: true,
layout: "default",
},
},
"api-separator": {
"api-reference-separator": {
title: "API Reference",
type: "separator",
},
Expand All @@ -38,21 +38,21 @@ const meta: MetaRecord = {
},
},
components: {
title: "components",
title: "Components",
theme: {
toc: true,
layout: "default",
},
},
hook: {
title: "hook",
"use-tracker": {
title: "useTracker",
theme: {
toc: true,
layout: "default",
},
},
"advanced-separator": {
title: "Advanced",
title: "Guides",
type: "separator",
},
batching: {
Expand All @@ -62,6 +62,22 @@ const meta: MetaRecord = {
layout: "default",
},
},
};

export default meta;
"data-type-validation": {
title: "Data Type Validation",
theme: {
toc: true,
layout: "default",
},
},
"example-separator": {
title: "Examples",
type: "separator",
},
"basic-example": {
title: "Basic",
theme: {
toc: true,
layout: "default",
},
},
} satisfies MetaRecord;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Quick Start
# Guide

Here's a simple example of how to use event-tracker:
Here's a simple example demonstrating how to use `event-tracker`:

```tsx
import { createTracker } from "@offlegacy/event-tracker";
Expand All @@ -14,7 +14,7 @@ const [Track, useTracker] = createTracker({
},
});

// Use in your app
// Usage within the app
function App() {
return (
<Track.Provider initialContext={{ userId: "user-123" }}>
Expand Down
189 changes: 0 additions & 189 deletions docs/src/content/en/components.mdx

This file was deleted.

17 changes: 14 additions & 3 deletions docs/src/content/en/components/index.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Provider

The `Provider` component connects and provides initial context to your application.
The `Provider` component attaches and provides the initial context to your application. It is one of the event components included as the first element of the tuple returned by `createTracker`.

```tsx
import { createTracker } from '@offlegacy/event-tracker'
Expand All @@ -10,12 +10,23 @@ const [Track] = createTracker({...})
function App() {
return (
<Track.Provider initialContext={{}}>
{/* Your app content */}
{/* Application */}
</Track.Provider>
)
}
```

## Reference

### Props

- `initialContext?: Context` - Initial context value
| Props | Type | Description | Example |
| ---------------- | --------- | --------------------- | ------------------- |
| `initialContext` | `Context` | Initial context value | `{ userId: '123' }` |

---

#### `initialContext` (required)

- Type: `Context`
- Description: The initial context value provided to the application.
Loading