Skip to content

Latest commit

 

History

History
54 lines (42 loc) · 1.32 KB

instructions.md

File metadata and controls

54 lines (42 loc) · 1.32 KB

The package has been configured successfully!

Define contract mapping

Make sure to first define the mapping inside the contracts/ally.ts file as follows.

import { FigmaDriver, FigmaDriverConfig } from 'adonis-ally-figma/build/standalone'

declare module '@ioc:Adonis/Addons/Ally' {
  interface SocialProviders {
    // ... other mappings
    figma: {
      config: FigmaDriverConfig
      implementation: FigmaDriver
    }
  }
}

Add driver config

Make sure to add the driver inside the config/ally.ts file as follows.

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

FIGMA_CLIENT_ID: Env.schema.string(),
FIGMA_CLIENT_SECRET: Env.schema.string(),