forked from adonisjs-community/ally-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
2,958 additions
and
3,588 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,54 @@ | ||
The package has been configured successfully! | ||
|
||
## Define contract mapping | ||
|
||
Make sure to first define the mapping inside the `contracts/ally.ts` file as follows. | ||
|
||
```ts | ||
import { YourDriver, YourDriverConfig } from 'ally-custom-driver/build/standalone' | ||
import { FigmaDriver, FigmaDriverConfig } from 'ally-figma-driver/build/standalone' | ||
|
||
declare module '@ioc:Adonis/Addons/Ally' { | ||
interface SocialProviders { | ||
// ... other mappings | ||
yourDriver: { | ||
config: YourDriverConfig | ||
implementation: YourDriver | ||
figma: { | ||
config: FigmaDriverConfig | ||
implementation: FigmaDriver | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Add driver config | ||
|
||
Make sure to add the driver inside the `config/ally.ts` file as follows. | ||
|
||
```ts | ||
const allyConfig: AllyConfig = { | ||
// ... other mappings | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Figma driver | ||
|-------------------------------------------------------------------------- | ||
*/ | ||
figma: { | ||
driver: 'figma', | ||
clientId: Env.get('FIGMA_CLIENT_ID'), | ||
clientSecret: Env.get('FIGMA_CLIENT_SECRET'), | ||
callbackUrl: 'http://localhost:3333/figma/callback', | ||
scopes: ['file_read'] | ||
}, | ||
} | ||
} | ||
``` | ||
|
||
## Validating environment variables | ||
|
||
Ally config relies on environment variables for the client id and secret. We recommend you to validate environment variables inside the `env.ts` file. | ||
|
||
### Variables for Figma provider | ||
|
||
```ts | ||
FIGMA_CLIENT_ID: Env.schema.string(), | ||
FIGMA_CLIENT_SECRET: Env.schema.string(), | ||
``` |
Oops, something went wrong.