5 Replies
Hi @dc_alexyt. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Yes, Refine does support JSON:API. A data provider for JSON:API was recently released by the community. You can find it here (https://github.com/mahirmahdi/refine-jsonapi) as mentioned in this discussion (https://github.com/refinedev/refine/discussions/5173).
As for Next.js, Refine has support for SSR - Next.js. This feature allows you to develop B2C applications in addition to B2B and admin panel. Refine can be used with Next.js to SSR your pages. It doesn't get in the way and follows Next.js conventions and also provides helper modules when necessary.
Here is a basic setup for SSR-Next.js with Refine:
And here is a basic usage example:
You can find more information on how to add SSR-Next.js to your Refine project in the official documentation (https://refine.dev/docs/guides-and-concepts/ssr/nextjs/).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
<@398749213795680259> kapa.ai is still learning and improving, please let us know how it did by reacting below
rare-sapphire•9mo ago
@kapa.ai
how do i connect with a json api?
Let me check the knowledge base for you. One moment! :books:
----------------------
To connect with a JSON API, you need to use a data provider. A data provider is a function or an object that interprets the commands sent by the
<Refine>
component and turns them into HTTP requests, then interprets the HTTP responses and turns them into the result format expected by <Refine>
.
Here is a basic example of how to connect with a JSON API using a data provider:
In this example, jsonServerDataProvider
is a data provider that communicates with a JSON API. You pass the URL of your API as a parameter to the jsonServerDataProvider
function. This function returns a data provider that you can pass to the <Refine>
component via the dataProvider
prop.
If you want to use a JSON:API, there is a community data provider available for it. You can find it here (https://www.npmjs.com/package/refine-jsonapi).
For more information on how to use data providers in Refine, you can refer to the official documentation (https://refine.dev/docs/tutorial/understanding-dataprovider/index#using-data-providers-in-refine).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@398749213795680259> kapa.ai is still learning and improving, please let us know how it did by reacting below