Base interface for provider credentials. Each provider extends this with their specific credential fields.

Remarks

TEMPORARY INTERFACE: This interface is an interim solution for the 2.x patch release. In MemberJunction 3.0, this will be replaced by a more comprehensive credential management system with database storage, encryption, and multi-tenancy support. The replacement interface will be located in @memberjunction/credentials or @memberjunction/core.

This interface is designed to be forward-compatible with the 3.0 CredentialResolutionOptions system. When migrating to 3.0, credential objects passed using this interface will work with the new system's directValues parameter.

See

plans/3_0_credentials_design.md for the full 3.0 credential system design

Example

// Provider-specific credentials extend this base
interface SendGridCredentials extends ProviderCredentialsBase {
apiKey?: string;
}

// Usage with fallback enabled (default)
await provider.SendSingleMessage(message, { apiKey: 'SG.xxx' });

// Usage with fallback disabled
await provider.SendSingleMessage(message, {
apiKey: 'SG.xxx',
disableEnvironmentFallback: true
});
interface ProviderCredentialsBase {
    disableEnvironmentFallback?: boolean;
}

Hierarchy

  • ProviderCredentialsBase

    Properties

    disableEnvironmentFallback?: boolean

    When true, environment variable fallback is DISABLED for this request. If credentials are incomplete and this is true, the request will fail rather than falling back to environment variables.

    Default

    false (fallback enabled for backward compatibility)
    

    Example

    // With fallback (default) - uses env var if apiKey not provided
    await provider.SendSingleMessage(message, {});

    // Without fallback - fails if apiKey not provided
    await provider.SendSingleMessage(message, {
    disableEnvironmentFallback: true
    });