Skip to Content
🎉 New release with new features and improvements! V0.0.2 Release →

Custom Authentication Function

For more control, use a custom authentication function:

const bshEngine = new BshEngine({ host: 'https://your-instance.com', authFn: async () => { // Get token from wherever you store it const token = localStorage.getItem('accessToken'); if (!token) return null; return { type: 'JWT', token: token}; } })

This allows you to dynamically retrieve tokens from any storage mechanism (localStorage, sessionStorage, cookies, secure storage, etc.).