Skip to content

hc with Credentials? #2485

@yusukebe

Description

@yusukebe

Discussed in https://github.com/orgs/honojs/discussions/2291

Originally posted by lajbel March 1, 2024
Looks pretty obvious to have something like credentials in the configuration of hc, something like this

const authClient = hc<SomeType>("/api/auth/", {
    headers: {} // You can already set headers!
    credentials: "include",
});

I was searching here and there's only one option available to do this approach

const api = hc<AppType>("api/auth", {
  fetch: (req, init) =>
    fetch(req, {
      ...init,
      credentials: "include", // Why not have all fetch options too?
    })
})

RPC is pretty awesome, but some things are missing

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