Skip to content

Commit

Permalink
docs: plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Bekacru committed Jul 23, 2024
1 parent 1b0ee2c commit 05ec54a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions doc/content/docs/plugins.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ const $fetch = createFetch({
</Callout>

### Schema
You can define a schema for the plugin. You can easily document api usage using this schema.

You can define a schema for a plugin. This allows you to easily document the api usage using a schema.

```ts twoslash title="fetch.ts"
import { createFetch, createSchema, BetterFetchPlugin } from "@better-fetch/fetch";
Expand All @@ -87,8 +88,7 @@ import { z } from "zod";
const plugin = {
id: "my-plugin",
name: "My Plugin",
schema: {
schema: createSchema({
schema: createSchema({
"/path": {
input: z.object({
/**
Expand All @@ -106,10 +106,9 @@ const plugin = {
completed: z.boolean(),
}),
}
}, {
},{
baseURL: "https://jsonplaceholder.typicode.com",
})
}
} satisfies BetterFetchPlugin;

const $fetch = createFetch({
Expand Down

0 comments on commit 05ec54a

Please sign in to comment.