This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
It is now set in the client and used as part of Inngest's middleware. The plugin will try to use
the Inngest client's logger first and then this logger setting.
// api/src/lib/inngest.ts
import { Inngest } from 'inngest';
import { logger } from './logger';
export const INNGEST_APP_NAME = 'Redwood_Inngest';
export const inngest = new Inngest({
/**
* The name of this instance, most commonly the name of the application it
* resides in.
*/
name: INNGEST_APP_NAME,
/**
* Inngest event key, used to send events to Inngest Cloud. If not provided,
* will search for the `INNGEST_EVENT_KEY` environment variable. If neither
* can be found, however, a warning will be shown and any attempts to send
* events will throw an error.
*/
eventKey: 'YOUR_INNGEST_EVENT_KEY',
/**
* Use the api logger for Inngest function logging, useful in scheduled functions
*/
logger: logger,
logLevel: 'info',
});
Delayed Functions
In addition to delaying via a sleep duration, you can now sleepUntil a timestamp or a variable
in event data:
async ({ event, step }) => {
await step.sleep('5s')
// You can run jobs at a specific time using the step.sleepUntil() utility:
// await step.sleepUntil("2023-04-01T12:30:00");
// You can also sleep until a timestamp within the event data. This lets you
// pass in a time for you to run the job:
// await step.sleepUntil(event.data.run_at) // Assuming event.data.run_at is a timestamp.
Scheduled Functions
A scheduled function now uses the logger to output success rather than a payload message.
Note that one can access Inngest's logger set on the client from the event:
This name is still defined in api/src/lib/inngest.ts:
export const INNGEST_APP_NAME = 'Redwood_Inngest'
export const inngest = new Inngest({
/**
* The name of this instance, most commonly the name of the application it
* resides in.
*/
name: INNGEST_APP_NAME,
RedwoodJS v6 canary builds may need the serve path to be
servePath: '/.redwood/functions/inngest' instead of simply /inngest.
One you then start the Inngest dev server as:
npx inngest-cli@latest dev -u http://localhost:8910/.redwood/functions/inngest
It is now set in the client and used as part of Inngest's middleware. The plugin will try to use
the Inngest client's logger first and then this logger setting.
// api/src/lib/inngest.ts
import { Inngest } from 'inngest';
import { logger } from './logger';
export const INNGEST_APP_NAME = 'Redwood_Inngest';
export const inngest = new Inngest({
/**
* The name of this instance, most commonly the name of the application it
* resides in.
*/
name: INNGEST_APP_NAME,
/**
* Inngest event key, used to send events to Inngest Cloud. If not provided,
* will search for the `INNGEST_EVENT_KEY` environment variable. If neither
* can be found, however, a warning will be shown and any attempts to send
* events will throw an error.
*/
eventKey: 'YOUR_INNGEST_EVENT_KEY',
/**
* Use the api logger for Inngest function logging, useful in scheduled functions
*/
logger: logger,
logLevel: 'info',
});
Delayed Functions
In addition to delaying via a sleep duration, you can now sleepUntil a timestamp or a variable
in event data:
async ({ event, step }) => {
await step.sleep('5s')
// You can run jobs at a specific time using the step.sleepUntil() utility:
// await step.sleepUntil("2023-04-01T12:30:00");
// You can also sleep until a timestamp within the event data. This lets you
// pass in a time for you to run the job:
// await step.sleepUntil(event.data.run_at) // Assuming event.data.run_at is a timestamp.
Scheduled Functions
A scheduled function now uses the logger to output success rather than a payload message.
Note that one can access Inngest's logger set on the client from the event:
This name is still defined in api/src/lib/inngest.ts:
export const INNGEST_APP_NAME = 'Redwood_Inngest'
export const inngest = new Inngest({
/**
* The name of this instance, most commonly the name of the application it
* resides in.
*/
name: INNGEST_APP_NAME,
RedwoodJS v6 canary builds may need the serve path to be
servePath: '/.redwood/functions/inngest' instead of simply /inngest.
One you then start the Inngest dev server as:
npx inngest-cli@latest dev -u http://localhost:8910/.redwood/functions/inngest
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
envelop-plugin-inngest@1.0.0
Major Changes
#153
6026af1
Thanks @dthyresson! - Updates to Inngest SDK v2Breaking Changes
Inngest SDK v2 has some breaking changes that will require some manual code change to existing apps.
Logging
Logging has changed in v2. See: https://www.inngest.com/docs/guides/logging.
It is now set in the client and used as part of Inngest's middleware. The plugin will try to use the Inngest client's logger first and then this logger setting.
Delayed Functions
In addition to delaying via a
sleep
duration, you can nowsleepUntil
a timestamp or a variable in event data:Scheduled Functions
A scheduled function now uses the logger to output success rather than a payload message.
Note that one can access Inngest's
logger
set on the client from theevent
:RedwoodJS
api/src/functions/inngest.ts
function has several changes:serve
handler, instead of theINNGEST_APP_NAME
now one passes the completeinngest
client.This name is still defined in
api/src/lib/inngest.ts
:serve
path to beservePath: '/.redwood/functions/inngest'
instead of simply/inngest
.One you then start the Inngest dev server as:
inngest-setup-redwoodjs@1.0.0
Major Changes
#153
6026af1
Thanks @dthyresson! - Updates to Inngest SDK v2Breaking Changes
Inngest SDK v2 has some breaking changes that will require some manual code change to existing apps.
Logging
Logging has changed in v2. See: https://www.inngest.com/docs/guides/logging.
It is now set in the client and used as part of Inngest's middleware. The plugin will try to use the Inngest client's logger first and then this logger setting.
Delayed Functions
In addition to delaying via a
sleep
duration, you can nowsleepUntil
a timestamp or a variable in event data:Scheduled Functions
A scheduled function now uses the logger to output success rather than a payload message.
Note that one can access Inngest's
logger
set on the client from theevent
:RedwoodJS
api/src/functions/inngest.ts
function has several changes:serve
handler, instead of theINNGEST_APP_NAME
now one passes the completeinngest
client.This name is still defined in
api/src/lib/inngest.ts
:serve
path to beservePath: '/.redwood/functions/inngest'
instead of simply/inngest
.One you then start the Inngest dev server as: