Skip to content

Zero-config library integrations #18

@brillout

Description

@brillout

For example:

// node_modules/some-auth-library/package.json

{
  "name": "some-auth-library",
  "exports": {
    "./hattip-auto-integration": "./dist/hattip.js"
  }
}
// node_modules/some-auth-library/hattip.ts

export default {
  addHattipMiddleware,
}

function addHattipMiddleware() {
  return (ctx) => {
    const response = await ctx.next();
    response.headers.set("Cookie", "auth-secret=...");
    return response;
  }
}

I would even go as far as to have HatTip read the pacakge.json#exports of all dependencies to see if they contain a HatTip zero-config integration.

So that all the user has to do is to npm install some-auth-library. Zero integration code needed. Works across all JS server platforms.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions