nestjs-airtable
v0.0.1
Published
NestJs Dynamic Module for AirtableJs.
Downloads
4
Maintainers
Readme
Description
A dynamic module for configuring Airtable in a Nest framework TypeScript project.
Installation
npm install nestjs-airtable
Getting Started
The Airtable Module exposes two static methods to configure the Airtable client: forRoot()
and forRootAsync()
.
Configuration
import { Module } from '@nestjs/common'
import { ConfigModule, ConfigService } from '@nestjs/config'
import { AirtableModule } from 'nestjs-airtable'
@Module({
imports: [
AirtableModule.forRoot({
apiKey: 'someSecretApiKey',
}),
],
})
export class MyModule {}
Async Configuration
import { Module } from '@nestjs/common'
import { ConfigModule, ConfigService } from '@nestjs/config'
import { AirtableModule } from 'nestjs-airtable'
@Module({
imports: [
AirtableModule.forRootAsync({
imports: [ConfigModule],
inject: [ConfigService],
useFactory: (configService: ConfigService) => ({
apiKey: configService.getOrThrow('AIRTABLE_API_KEY'),
}),
}),
],
})
export class MyModule {}
Contribute
Feel free to fork the repo and open a pull-request to contribute to the project directly, or submit an issue if you find a bug.