这就是我所拥有的
import { CognitoIdentityServiceProvider } from 'amazon-cognito-identity-js';
var params = {
GroupName: 'Berater',
UserPoolId: 'eu-central-1_YQtTjK3DB',
Username: 'testuser'
};
CognitoIdentityServiceProvider.adminAddUserToGroup(params, function(err, data) {
if (err) console.log('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb: ', err, err.stack); // an error occurred
else console.log(data); // successful response
})
但是我不断收到这样的错误消息:CognitoIdentityServiceProvider
没有从amazon-cognito-identity-js
导出,所以我的问题是deos人是从哪里导入它的?谢谢!
答案 0 :(得分:2)
CognitoIdentityServiceProvider
是AWS开发工具包的一部分。
您应该先从'aws-sdk'导入AWS:
var AWS = require('aws-sdk');
var cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider();
cognitoidentityserviceprovider.adminForgetDevice(params, function (err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
您可以在此处查看文档:{{3}}