JJ
JJ
NNuxt
Created by JJ on 9/18/2024 in #❓・help
Is there an equivalent to unstable_after() in h3?
https://nextjs.org/docs/app/api-reference/functions/unstable_after Im running into an issue with stripe where I need to respond quickly before doing some longer running tasks. Does Nuxt/nitro/h3 have some version of unstable_after() where i can send off a 200 status code then keep doing work in a serverless env?
8 replies
NNuxt
Created by JJ on 5/22/2023 in #❓・help
Import .env into app{ head{ script{
Im loading a analytics script inside my nuxt.config.ts and want to dynamically change the key via an env var, but the scope doesnt have acess to process or useRUntimeConig, any thoughts:
app: {
head: {
script: [
{
hid: 'Rudder-JS',
src: 'https://myurl/dataPlane',
defer: true
},
{
hid: 'rudder-js',
innerHTML: `
rudderanalytics = window.rudderanalytics = [];
var methods = [
'load',
'page',
'track',
'identify',
'alias',
'group',
'ready',
'reset',
'getAnonymousId',
'setAnonymousId'
];
for (var i = 0; i < methods.length; i++) {
var method = methods[i];
rudderanalytics[method] = function (methodName) {
return function () {
rudderanalytics.push([methodName].concat(Array.prototype.slice.call(arguments)));
};
}(method);
}
const config = useRuntimeConfig()
console.log(config.rudderstack)
rudderanalytics.load(config.rudderstack,
'https://myurl',
{ configUrl: 'https://myurl' });

//rudderanalytics.page();
`,
type: 'text/javascript',

}
],
},
},
app: {
head: {
script: [
{
hid: 'Rudder-JS',
src: 'https://myurl/dataPlane',
defer: true
},
{
hid: 'rudder-js',
innerHTML: `
rudderanalytics = window.rudderanalytics = [];
var methods = [
'load',
'page',
'track',
'identify',
'alias',
'group',
'ready',
'reset',
'getAnonymousId',
'setAnonymousId'
];
for (var i = 0; i < methods.length; i++) {
var method = methods[i];
rudderanalytics[method] = function (methodName) {
return function () {
rudderanalytics.push([methodName].concat(Array.prototype.slice.call(arguments)));
};
}(method);
}
const config = useRuntimeConfig()
console.log(config.rudderstack)
rudderanalytics.load(config.rudderstack,
'https://myurl',
{ configUrl: 'https://myurl' });

//rudderanalytics.page();
`,
type: 'text/javascript',

}
],
},
},
12 replies