nest-tiktok-sdk-applet
TypeScript icon, indicating that this package has built-in type declarations

0.0.8 • Public • Published

Nest Logo

nest-tiktok-sdk-applet ⚠️temporary internal use

tiktok ISV SDK

内部测试版本请勿用于生产

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!

Package Sidebar

Install

npm i nest-tiktok-sdk-applet

Weekly Downloads

1

Version

0.0.8

License

ISC

Unpacked Size

21.6 kB

Total Files

20

Last publish

Collaborators

  • c-uncle