Skip to content

Commit

Permalink
Completed
Browse files Browse the repository at this point in the history
  • Loading branch information
phicoder committed Mar 31, 2022
1 parent 0392c7d commit 8fd9dd5
Show file tree
Hide file tree
Showing 9 changed files with 2,958 additions and 3,588 deletions.
45 changes: 41 additions & 4 deletions instructions.md
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(),
```
Loading

0 comments on commit 8fd9dd5

Please sign in to comment.