Open andreas-karlsson opened 1 month ago
For now, the workaround is to use an approach similar to this:
async function main() {
const { Confidence } = await import("@spotify-confidence/sdk");
const confidence = Confidence.create({
...
});
const flagValue = await confidence.getFlag("MyFlag.flag_property", false);
console.log("Flag value: ", flagValue);
}
main();
and combine it with the following in the tsconfig.json
of the project:
"ts-node": {
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "Node"
}
},
It's still tricky to make Node execute TS with esm imports.
Feature Suggestion
Add cjs output in the build.