Closed Agugori closed 1 year ago
im using it on a nestjs app
sorry for the late response...
For now you have to use this: import Qualtrics = require('qualtrics-api');
. I will probably change it in the future
This code worked for me without turning on the 'esModuleInterop' flag.
import { Controller, Get } from '@nestjs/common';
import { AppService } from './app.service';
import Qualtrics = require('qualtrics-api');
const config = {
apiToken: '<apiToken>',
baseUrl: 'https://eu.qualtrics.com/API/v3/',
defaultDirectory: '<defaultDirectory>',
};
const qualtrics = new Qualtrics(config);
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
@Get()
async getHello(): Promise<string> {
return qualtrics.whoami();
}
}
Hello there, im trying to import Qualtrics but i got this error
'Qualtrics' can only be imported by using 'import Qualtrics = require("qualtrics-api")' or by turning on the 'esModuleInterop' flag and using a default import.ts(2617)
this is the way im importing it, im already try to do it without the breakets
this is my tsconfig.ts