MongoDB.live, free & fully virtual. June 9th - 10th. Register Now

Stitch Function without Authentication

Hello,

There are some business logics that require running a function without authentication such as sending a text message during user sign up. Is there a way to call stitch function from client without auth (e.g anonymous auth) now or in the plan? Thanks!

1 Like

Hi @Alex_Wu, welcome!

You should be able to do this now using Anonymous Authentication. For example using the JavaScript SDK:

Stitch.defaultAppClient.auth.loginWithCredential(new AnonymousCredential()).then(user => {
    Stitch.defaultAppClient.callFunction("foobar", [argument]).then(response=>{
        console.log(result);
    });    
}).catch(console.error);

Regards,
Wan

1 Like