Skip to content

Commit

Permalink
Specify DatabaseDefinitions origins for Sveltekit (Get types working) (
Browse files Browse the repository at this point in the history
…supabase#326)

* Specify DatabaseDefinitions origins

Specify how DatabaseDefinitions was created using Supabase CLI.

Co-authored-by: Andrew Smith <[email protected]>
  • Loading branch information
braden-w and silentworks authored Jan 14, 2023
1 parent 7c60656 commit 7ddaa6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/sveltekit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ export const load: LayoutLoad = async (event) => {

This results in less server calls as the client manages the session on it´s own.

### Typings
### Typings with v2 from Supabase CLI

In order to get the most out of TypeScript and it´s intellisense, you should import our types into the `app.d.ts` type definition file that comes with your SvelteKit project.
In order to get the most out of TypeScript and it´s intellisense, you should import the generated Database types into the `app.d.ts` type definition file that comes with your SvelteKit project, where `import('./DatabaseDefinitions')` points to the generated types file outlined in [v2 docs here](https://supabase.com/docs/reference/javascript/release-notes#typescript-support) after you have logged in, linked, and generated types through the Supabase CLI.

```ts
// src/app.d.ts
Expand Down

0 comments on commit 7ddaa6a

Please sign in to comment.