> There is Brayden's elegant Alarm class but it's not documented, and by default requires your DO ex

There is Brayden's elegant Alarm class but it's not documented, and by default requires your DO extend the Actor base class unless you duplicate what that base class does manually.
You actually don't need the Actor base class. I am a fan of toolkits personally, so we tried most some of the functionality in the
actors
package to make it available on its own, only depending on the
ctx.storage
of SQLite Durable Objects.

See example in https://github.com/cloudflare/actors/blob/e910e86ac1567fe58e389d1938afbdf1e53750ff/examples/durable-objects/src/index.ts#L21

export class MyDurableObject extends DurableObject<Env> {
    storage: Storage;
    alarms: Alarms<this>;
    
    constructor(ctx: DurableObjectState, env: Env) {
        super(ctx, env)
        this.storage = new Storage(ctx.storage);
        this.alarms = new Alarms(ctx, this);
    }
    ...
}


Same goes for the SQL Schema migrations, you can use them without the Actor base class, and retry utilities too.
Was this page helpful?