nest-tiktok-sdk-applet
v0.0.8
Published
tiktok-sdk-applet
Downloads
13
Maintainers
Readme
Installation
Yarn
yarn nest-tiktok-sdk-applet
# APPID 三方小程序APPID
# AUTH_URL 获取授权地址
# COMPONENT_APPID ISV APPID
NPM
npm install nest-tiktok-sdk-applet
Getting Started
Let's register the ClickHouseModule in app.module.ts
import { Module } from '@nestjs/common'
import { TiktokSdkAppletModule} from 'nest-tiktok-sdk-applet'
@Module({
imports: [
TiktokSdkAppletModule.forRoot({
APPID: configService.get('APPID'),
AUTH_URL: configService.get('AUTH_URL'),
COMPONENT_APPID: configService.get('COMPONENT_APPID'),
}),
],
})
export class AppModule {}
With Async
import { Module } from '@nestjs/common';
import { TiktokSdkAppletModule} from 'nest-tiktok-sdk-applet'
@Module({
imports: [
TiktokSdkAppletModule.forRootAsync({
useFactory: (configService: ConfigService) => ({
APPID: configService.get('APPID'),
AUTH_URL: configService.get('AUTH_URL'),
COMPONENT_APPID: configService.get('COMPONENT_APPID'),
}),
inject:[ConfigService]
}),
],
})
export class AppModule {}
And use in your service
import { Injectable } from '@nestjs/common';
import { TiktokSdkAppletService } from 'nest-tiktok-sdk-applet';
@Injectable()
export class TestService {
constructor(
private readonly tiktokSdkAppletService: TiktokSdkAppletService
) { }
}
Options
export interface ConfigModule {
AUTH_URL: string;
APPID: string;
COMPONENT_APPID: string;
}
That's it!