Skip to content

Conversation

@Takaros999
Copy link
Contributor

@Takaros999 Takaros999 commented Jan 16, 2026

Builds on top of #44, please review that first.

This PR refactors idkit-core:

  • Rewritten from scratch, it exposes the Session from wasm module
  • Updates broswer example

Confirmed the refactor works by testing the broswer example.

I will follow up with a react a package and a next example

Resolves DEV-2635

@Takaros999 Takaros999 changed the title Takis/js-core-refactor feat!: Refactor idkit-core JS package Jan 16, 2026
@Takaros999 Takaros999 marked this pull request as ready for review January 16, 2026 15:53
Copy link
Collaborator

@andy-t-wang andy-t-wang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine to me generally. I wonder if we need to split the signal out can we just parse it signal?: string | Uint8Array. Do you see a benefit?

* @returns Hash output
*/
export const generateSignal = (signal: IDKitConfig['signal']): HashFunctionOutput => {
export const generateSignal = (signal: AbiEncodedValue | string | undefined): HashFunctionOutput => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is i better to unpack the type. I feel like we should call this the signalHash

Suggested change
export const generateSignal = (signal: AbiEncodedValue | string | undefined): HashFunctionOutput => {
export const generateSignalHash = (signal: AbiEncodedValue | string | undefined): HashFunctionOutput => {

@@ -0,0 +1,183 @@
/**
* IDKit Session
* Pure functional API for World ID verification - no dependencies
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow

* const session = await createSession({
* app_id: 'app_staging_xxxxx',
* action: 'my-action',
* requests: [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should talk about syntax here too with requests and policies. How to do all, any etc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im refactoring this next up

Resolved conflicts:
- js/examples/browser/index.html: Keep new Session API
- js/packages/core/src/__tests__/smoke.test.ts: Keep HEAD version
- Deleted bridge.ts, client.ts, react/index.ts, react/types.ts (intentionally removed in refactor)
@vercel
Copy link

vercel bot commented Jan 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
idkit-js-example Error Error Jan 19, 2026 6:06pm

Request Review

@Takaros999 Takaros999 merged commit 713dc4b into main Jan 19, 2026
10 checks passed
@Takaros999 Takaros999 deleted the takis/js-core-refactor branch January 19, 2026 18:58
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.

3 participants