【发布时间】:2021-10-31 06:09:49
【问题描述】:
我们通常使用下面的语句来使用js在节点文件中使用authy库,主要是通过require语句!
const authy = require('authy')('API KEY');
我已将我的代码移动到嵌套生态系统,现在我应该如何使用 typescript 做同样的事情,因为我还想将 API 密钥传递给它? 我也试过下面的代码,但还是不行
import { authy } from 'authy'(API KEY)
提出一些建议!
【问题讨论】:
-
import authy from 'authy'; authy('API KEY') -
了解 ESM 的语法:exploringjs.com/impatient-js/…
-
@Kapobajza 不工作
标签: node.js typescript twilio nestjs authy