How to store a credential from the app after the installation?

hi,
I have developed an app, which produces/returns bearer token/auth credentials and app version after going OAuth process. This credentials has to be stored in the app (app data store ) to make 3rd party api’s call .

do freshdesk apps has any api exposed which updates or creates an entry in app data store ( key-value store (KV store))?

zendesk provides/exposes an endpoint to update the app context where all credentials and app version is stored after installing an app.

any leads in freshdesk in this regard?

I guess you could in theory use external events do store it:
https://developers.freshworks.com/docs/app-sdk/v2.3/freshdesk/serverless-apps/external-events/

I use this to set set DB data using Freshworks Developer Docs | Key-value storage

Not sure I’d use that for credentials though since it is not a secure way of storing data

1 Like

i have created an frontend app, the docs say that we can receive data via externalevents via webhooks for serverless-apps. can frontend apps receive data in same way from 3 party api’s or services?

Hi @Marri_Sri_Rahul_Sidd,

The platform natively supports OAuth 2.0 to make API requests with OAuth credentials. If it’s OAuth 2.0 that the third-party/external service provides, this feature can be used.

If you are not using OAuth 2.0, you can use Installation Parameters to get the app credentials through the configuration page after installation. This will be available in the app through a secure iparam template in the request method to make API requests to third-party services.

If you use either of these services, there’s no need to manually store the credential anywhere to use in the app. Let us know if you still need another way and why is that.

Hi @Raviraj
the credentials are generated after a process, which is intiated in the app , so we can’t provide them during the installation .

even OAuth 2.0 doesn’t help with our requirement. @Raviraj
I think external events will help us , but really not sure whether external events are possible in frontend apps.

any leads in regard of this is helpful.

zendesk provides an endpoint to update the frontend app context (app storage) after installation.
does freshdesk expose any endpoint to update the frontend app storage?

@Marri_Sri_Rahul_Sidd If the credentials get generated in the app, there are only two storage options available and we do not provide encryption.

  1. Key-Value Storage
  2. Entity Storage

They are stored as text in our database. So, it has to be encrypted in the app before storing it if required.

If it’s a credential, it would be recommended to handle it only in the Serverless app as it is a sensitive data and no one should see it and it should not be sent in wire or stored in any storage directly from the frontend app.

okay, wat is the timeout for calling an 3 party api from server.js?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.