withProvider() not implemented in a Custom UI app


const google = api.asUser().withProvider('google', 'google-apis');

We’re using the above snippet in static/hello-world/src/App.js in a Custom UI app and getting the below error in the console. However, it’s working as expected in a vanilla UI kit app.

Does it mean that external authentication is not supported in Custom UI?

Uncaught (in promise) Error: not implemented
    at Object.d [as withProvider] (fetch.js:39:11)
    at App.js:6:31
    at d (regeneratorRuntime.js:44:17)
    at Generator.<anonymous> (regeneratorRuntime.js:125:22)
    at Generator.next (regeneratorRuntime.js:69:21)
    at i (asyncToGenerator.js:3:20)
    at u (asyncToGenerator.js:22:9)
    at asyncToGenerator.js:27:7
    at new Promise (<anonymous>)
    at asyncToGenerator.js:19:12

Thank you

The @forge/api package can only be used in Forge functions. You have to run api.asUser()... in a resolver and invoke the resolver function using the custom UI bridge.

Thank you, @klaussner. It works!

1 Like