NAME

Punk::Push - Web Push notifications for Punk

SYNOPSIS

package MyApp;
use Punk;
use Punk::Plugin::Push;

host 'https://example.com';

plugin 'Push' => {
    subject     => 'mailto:ops@example.com',
    public_key  => { '$env' => 'VAPID_PUBLIC'  },
    private_key => { '$env' => 'VAPID_PRIVATE' },
};

post '/reports' => sub {
    my ($c) = @_;
    $c->push_send($c->auth_id, {
        title => 'Your report is ready',
        body  => 'Three pages, as usual.',
        url   => '/reports/2026-09',
    });
    return $c->json({ ok => 1 });
};

SEE ALSO

Punk::Plugin::Push for the plugin, its options and its helpers.

VAPID for the RFC 8291 encryption and the RFC 8292 identification underneath.

Punk.

AUTHOR

LNATION <email@lnation.org>

LICENSE AND COPYRIGHT

This software is Copyright (c) 2026 by LNATION <email@lnation.org>.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)