supertokens / supertokens-node

Node SDK for SuperTokens core
https://supertokens.com
Other
278 stars 72 forks source link

Use of Supertokens Dashboard in offline environments #818

Closed djuelg closed 3 months ago

djuelg commented 3 months ago

Hi, I am currently working on implementing a user management solution with Supertokens. I have planned to run the solution in an environment without internet access.

However, if I see it correctly, it is not possible to use the dashboard without internet as it is loaded via the getDashboardBundleLocation method from the hardcoded address cdn.jsdelivr.net. Are there any plans to mitigate this problem in the future or to offer configuration options?

Kind regards, Dominik

rishabhpoddar commented 3 months ago

You can always override that api in dashboard.init on the backend to return a bundle from somewhere else that you like. I think that can work.

djuelg commented 3 months ago

Thanks, that helped! The solution looks something like this:

Dashboard.init({
            override: {
                functions: (originalImplementation) => {
                    return {
                        ...originalImplementation,
                        getDashboardBundleLocation: async function () {
                            return `https://MY-LOCAL-CDN/dashboard@0.11.1/build/`;
                        }
                    }
                }
            }
        })
lunarnaut-consulting commented 2 months ago

Thanks, that helped! The solution looks something like this:

Dashboard.init({
            override: {
                functions: (originalImplementation) => {
                    return {
                        ...originalImplementation,
                        getDashboardBundleLocation: async function () {
                            return `https://MY-LOCAL-CDN/dashboard@0.11.1/build/`;
                        }
                    }
                }
            }
        })

cdn.jsdelivr.net is down right now due to cert errors, so this was really helpful, thanks!

Dashboard.init({
      override: {
        functions: (originalImplementation) => {
          return {
            ...originalImplementation,
            getDashboardBundleLocation: async function() {
              return `https://fastly.jsdelivr.net/gh/supertokens/dashboard@v0.11/build/`
            }
          }
        }
      }
    }),
rishabhpoddar commented 2 months ago

Hopefully they fix it soon!