Vana SDK - v2.2.2
    Preparing search index...

    Class ServerUrlMismatchError

    Thrown when attempting to register a server with a URL different from its existing registration.

    This error occurs when trying to add or trust a server that's already registered on-chain with a different URL. Server URLs are immutable once registered to maintain consistency and security. Applications should use the existing URL or register a new server with a different ID.

    try {
    await vana.permissions.addAndTrustServer({
    serverId: 1,
    serverUrl: 'https://new-url.com',
    publicKey: '0x...'
    });
    } catch (error) {
    if (error instanceof ServerUrlMismatchError) {
    console.log(`Server already registered with: ${error.existingUrl}`);
    // Use existing URL or register new server
    }
    }

    Hierarchy (View Summary)