New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to connect to European Data Center with the web SDK? #356
Comments
Hi @mistyharsh, currently investigating this. Thanks for the writeup. |
@mistyharsh we are cutting a new release. once that is out, please use that version and try again and your issue should be resolved :) |
@mistyharsh this update is in release v1.0.9. Please let us know if this resolves your issue! |
Hey @mprew97, I tried this last week and the issue still persists with version import { defineConfig } from 'vite';
export default defineConfig({
define: {
'process.env.IS_EU_ITERABLE_SERVICE': '"true"',
// As well as this too
'process.env.IS_EU_ITERABLE_SERVICE': 'true',
},
}); However, the requests never reaches the EU API endpoint. I used both the files
However, this flag works when I use the un-minified import from |
@mistyharsh interesting. will work on reproducing... in the meantime, can you try making use of the You should be able to import and call |
@mistyharsh Alright, we have a fix released for this particular issue! In order to get this working, you will need to upgrade the SDK to v1.0.11 and make some minor updates to the SDK initialization method. Instead of using the initialize method to initialize the SDK, you will need to call the new method initializeWithConfig. This will enable you to pass in a new configuration object which contains the toggle See these docs for more details. |
Thanks @mprew97 for the update. I tested this new SDK yesterday with both the suggested approaches: The only change I had to do with const { setEmail } = initializeWithConfig({
authToken: process.env.API_KEY,
configOptions: {
isEuIterableService: true,
},
generateJWT: fetchJWT
}); One last question. Is the |
I am having difficulty in connecting to the Iterable's European data center. I tried using NPM approach as well as CDN approach as documented here. But, SDK always connects to the default endpoint (
https://api.iterable.com/api
).As the guidelines says:
I used following different means to setup this flag.
process.env.IS_EU_ITERABLE_SERVICE = true
.globalThis.IS_EU_ITERABLE_SERVICE = true
.window.IS_EU_ITERABLE_SERVICE = true
.CDN approach.
I used following script to initialize the Iterable SDK:
But as I see in this compiled code, the flag is used as shown below:
As far as I understand, the condition will always be false and would always pick the default
api.iterable.com
URL,NPM approach
With NPM approach, I get the same requests. I tried using both files specified by
main
andbrowser
field in the package.json file of the package:main
field points toindex.node.js
file.browser
field points toindex.js
file.We are using two bundlers - Vite and Webpack. And, we can configure to to pick any file. But it looks like the code is already compiled where the
IS_EU_ITERABLE_SERVICE
flag is never initialized anywhere in the compiled code. Both files contain the code similar to the one served by CDN.I used versions
1.0.8
and latest1.1.0-beta
. Is there any other solution for this?The text was updated successfully, but these errors were encountered: