Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: version packages #897

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

silverhand-bot
Copy link
Collaborator

@silverhand-bot silverhand-bot commented Jan 2, 2025

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.

Releases

@logto/[email protected]

Minor Changes

  • a0f91a3: support custom external session storage

    Add sessionWrapper to the config, you can implement your own session wrapper to support custom external session storage.

    Take a look at the example below:

    import { MemorySessionWrapper } from './storage';
    
    export const config = {
      // ...
      sessionWrapper: new MemorySessionWrapper(),
    };
    import { randomUUID } from 'node:crypto';
    
    import { type SessionWrapper, type SessionData } from '@logto/next';
    
    export class MemorySessionWrapper implements SessionWrapper {
      private readonly storage = new Map<string, unknown>();
    
      async wrap(data: unknown, _key: string): Promise<string> {
        const sessionId = randomUUID();
        this.storage.set(sessionId, data);
        return sessionId;
      }
    
      async unwrap(value: string, _key: string): Promise<SessionData> {
        if (!value) {
          return {};
        }
    
        const data = this.storage.get(value);
        return data ?? {};
      }
    }

    You can implement your own session wrapper to support custom external session storage like Redis, Memcached, etc.

@logto/[email protected]

Patch Changes

  • 733e978: support ssr for browser-based SDKs

    Check if the window is defined, if not, ignore the storage operations, avoid breaking the server side rendering.

    For this kind of SDKs, it doesn't make sense to be used in server side, because the auth state is usually stored in the client side which is not available in server side. So we can safely ignore the storage operations in server side.

@logto/[email protected]

Patch Changes

@logto/[email protected]

Patch Changes

@logto/[email protected]

Patch Changes

@logto/[email protected]

Patch Changes

@logto/[email protected]

Patch Changes

@logto/[email protected]

Patch Changes

@logto/[email protected]

Patch Changes

@logto/[email protected]

Patch Changes

@logto/[email protected]

Patch Changes

@silverhand-bot silverhand-bot force-pushed the changeset-release/master branch from 9414d3a to c1b432d Compare January 7, 2025 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant