Skip to content

docs: persist authToken across sessions + warn about REST Accept header - #212

Open
enkunkun wants to merge 1 commit into
evex-dev:mainfrom
enkunkun:docs/persist-authtoken-and-bun-note
Open

docs: persist authToken across sessions + warn about REST Accept header#212
enkunkun wants to merge 1 commit into
evex-dev:mainfrom
enkunkun:docs/persist-authtoken-and-bun-note

Conversation

@enkunkun

@enkunkun enkunkun commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Description

Two small documentation additions covering footguns I hit while integrating
LINEJS from Bun/TypeScript. Both were nontrivial to diagnose from the existing
docs.

  • docs/auth.md — new Persisting authToken across sessions section
    showing the update:authtoken + FileStorage pattern.
    FileStorage auto-persists cert, refreshToken and expire (per
    packages/linejs/base/storage/kvTypes.ts) but authToken is not in the
    known key set
    , so users must save it themselves via the
    update:authtoken event. Without an example this is easy to miss, and the
    next-run fallback to loginWithPassword increases ban risk.

  • docs/methods.md — new Calling LINE REST endpoints directly note.
    client.base.request.getHeader("GET") returns
    accept: application/x-thrift, which causes JSON REST endpoints (Album /
    Moa, parts of Timeline, ...) to reject the request with
    {"code":102001,"message":"一時的なエラーが発生しました。"} at HTTP 200. Documents
    the required accept: application/json override.

Docs-only, no code or test changes.

Checklist

  • Docs only (no runtime code touched)
  • vitepress build succeeds (verified locally)

@enkunkun
enkunkun force-pushed the docs/persist-authtoken-and-bun-note branch from 1d524e6 to effdd73 Compare July 23, 2026 00:51
…ader

Two small documentation additions covering footguns I hit while integrating
LINEJS from Bun/TypeScript. Both were nontrivial to diagnose from the existing
docs.

- docs/auth.md: add "Persisting authToken across sessions" section showing
  the `update:authtoken` + FileStorage pattern. FileStorage auto-persists
  `cert`, `refreshToken` and `expire` (per
  packages/linejs/base/storage/kvTypes.ts) but `authToken` itself is not one
  of them — users must save it themselves via the event. Without an example
  this is easy to miss, and the next-run fallback to loginWithPassword
  increases ban risk.
- docs/methods.md: add "Calling LINE REST endpoints directly" note. The
  default client.base.request.getHeader("GET") returns
  `accept: application/x-thrift`, which causes JSON REST endpoints (Album /
  Moa, parts of Timeline, ...) to reject the request with
  `{"code":102001,"message":"一時的なエラーが発生しました。"}` at HTTP 200.
  Documenting the required `accept: application/json` override saves the
  next user a few hours.
@enkunkun
enkunkun force-pushed the docs/persist-authtoken-and-bun-note branch from effdd73 to 69a4533 Compare July 23, 2026 00:51
@enkunkun enkunkun changed the title docs: persist authToken across sessions, Bun install caveat, REST Accept header docs: persist authToken across sessions + warn about REST Accept header Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant