sveltekit-adapter-aws icon indicating copy to clipboard operation
sveltekit-adapter-aws copied to clipboard

add bridgeAuthToken option to AdapterOptions to simplify CDK integration

Open kainosk opened this issue 7 months ago • 2 comments

Previously, bridgeAuthToken was always generated at build time using nanoid(), which meant the token value was not known until the build completed. This made it difficult to coordinate with external CDK-managed resources such as CloudFront headers.

While the default CDK stack generated by this adapter is sufficient in most cases, some use cases may require customization of the infrastructure.

This PR adds support for explicitly providing a bridgeAuthToken via AdapterOptions. If not provided, a token will still be automatically generated as before.

By allowing the token to be injected ahead of time, this change enables more deterministic and flexible integration between CloudFront and the Lambda function.


I'm still learning npm, SvelteKit, and AWS, so please forgive me if this PR misses the mark. Thank you very much for taking the time to review it.

Summary by CodeRabbit

  • New Features
    • Added support for an optional authentication token to enhance security for requests from CloudFront to deployed Lambda functions. If not provided, a token will be generated automatically.

kainosk avatar Apr 15 '25 02:04 kainosk