@@ -45,6 +45,19 @@ That's it! Your Nuxt project now has a database. ✨
4545
4646If you do not already have [ EdgeDB] ( https://www.edgedb.com ) installed on your machine, the install wizard will help you to install it.
4747
48+ ## Example project
49+
50+ If you want to run the example project, you have to git clone this repository and run the playground.
51+
52+ As EdgeDB cannot run on web containers environment like Stackblitz or CodeSandbox, you must clone the project locally to run this playground.
53+
54+ ``` bash
55+ git clone git@github.com:Tahul/nuxt-edgedb.git
56+ cd nuxt-edgedb
57+ pnpm install
58+ cd playground && pnpm run dev
59+ ```
60+
4861## Server usage
4962
5063The module provides auto-imported composables available anywhere inside ` server/ ` context of your Nuxt app.
@@ -443,7 +456,31 @@ NUXT_EDGEDB_AUTH_VERIFY_REDIRECT_URL=http://localhost:3000/auth/verify
443456
444457EdgeDB Auth only provides bare minimal identity feature for authentication.
445458
446- In the code example I provided, I added a ` User ` type that goes along with the ` Identity ` interface.
459+ In the code example provided for authentication setup, a ` User ` type goes along with the ` Identity ` interface.
460+
461+ If you want to fill ` User ` with other attributes upon user registration, you will have to implement this behavior.
462+
463+ The initial authentication workflow is made to be as minimal as possible so anyone can build any kind of authentication and roles system on top of it.
464+
465+ If you want to resolve data from OAuth providers, you can use the Nitro hook called ` edgedb:auth:callback ` from a Nitro plugin.
466+
467+ ```
468+ // server/plugins/auth.ts
469+
470+ export default defineNitroPlugin((app) => {
471+ app.hooks.hook('edgedb:auth:callback', (data) => {
472+ const {
473+ code,
474+ verifier,
475+ codeExchangeUrl,
476+ codeExchangeResponseData,
477+ } = data
478+
479+ // codeExchangeResponseData contains the OAuth token from the provider.
480+ // ... implement your own authentication logic.
481+ })
482+ })
483+ ```
447484
448485## Production
449486
@@ -516,6 +553,7 @@ No, as they are generated with your Nuxt client, you should add them to your `.g
516553**/*.edgeql.ts
517554dbschema/queries.*
518555dbschema/query-builder
556+ dbschema/interfaces.ts
519557queries/*.query.ts
520558```
521559
@@ -543,6 +581,12 @@ It seem to be taken by [`ohmree`](https://github.com/ohmree), but the package se
543581
544582If anyone happens to know him, I would be happy to get in contact!
545583
584+ ### Contributions
585+
586+ There is still plenty of great features to build for this integration.
587+
588+ I would be happy to receive and review any Pull Request.
589+
546590## Development
547591
548592``` bash
@@ -569,6 +613,10 @@ npm run test:watch
569613npm run release
570614```
571615
616+ ## Sponsors
617+
618+ [ ![ thecompaniesapi.com] ( ./.github/thecompaniesapi.png )] ( https://thecompaniesapi.com )
619+
572620<!-- Badges -->
573621[ npm-version-src ] : https://img.shields.io/npm/v/nuxt-edgedb-module/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
574622[ npm-version-href ] : https://npmjs.com/package/nuxt-edgedb-module
0 commit comments