3 years ago

Consuming an internal API with Spark.

Posted 3 years ago by ZetecVan

I am using Vue Tables 2 to call an internal API to list some data. I want the API to retrieve more data for logged in users (ie: some values are to be unavailable to non-logged in users, to encourage them to sign up).

In the Spark docs there is this:

Spark makes it entirely painless to consume your API in this way. Simply make requests to your > API routes using your JavaScript framework as normal. You do not need to pass any token or credentials. All of the authentication will be handled automatically by Spark, which generates "transient", short-lived API tokens behind the scenes automatically when users load your application's pages. These API tokens are automatically refreshed in the background by Spark.

I remember seeing a video a while ago where (I think) Taylor demonstrates this functionality. Can anyone point me in the direction of the video, or suggest any way to do this.

Please sign in or create an account to participate in this conversation.