@builder.io/sdk-qwik 0.1.15 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -107,6 +107,63 @@ export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
107
107
 
108
108
  ```
109
109
 
110
+ ### [Beta] Guide to use API Version v3 to query for content
111
+
112
+ For using API Version `v3`, you need to add `apiVersion: 'v3'` to the `getContent` function and in the `RenderContent` tag. For example:
113
+
114
+ ```typscript
115
+ import { component$ } from "@builder.io/qwik";
116
+ import { loader$ } from "@builder.io/qwik-city";
117
+ import {
118
+ getBuilderSearchParams,
119
+ getContent,
120
+ RenderContent,
121
+ } from "@builder.io/sdk-qwik";
122
+
123
+ export const BUILDER_PUBLIC_API_KEY = "YOUR_API_KEY_GOES_HERE";
124
+ export const MODEL = "page";
125
+
126
+ export const builderContentLoader = loader$(({ url }) => {
127
+ return getContent({
128
+ model: MODEL,
129
+ apiKey: BUILDER_PUBLIC_API_KEY,
130
+ apiVersion: "v3",
131
+ options: {
132
+ ...getBuilderSearchParams(url.searchParams),
133
+ cachebust: true,
134
+ },
135
+ userAttributes: {
136
+ urlPath: url.pathname || "/",
137
+ },
138
+ });
139
+ });
140
+
141
+ export default component$(() => {
142
+ const builderContent = builderContentLoader.use();
143
+ return (
144
+ <div>
145
+ <RenderContent
146
+ model={MODEL}
147
+ content={builderContent.value}
148
+ apiKey={BUILDER_PUBLIC_API_KEY}
149
+ apiVersion="v3"
150
+ />
151
+ </div>
152
+ );
153
+ });
154
+
155
+ ```
156
+
157
+ #### Reasons to switch to API Version v3
158
+
159
+ - Better, more scalable infra: Query v3 is built on global scale infrastructure to ensure fast response times and high availability
160
+ - Ability to ship more features, faster: Query V3 will allow us to keep shipping the latest features to our customers without breaking fundamental flows. These will be shipped only to Query V3 and not to the older versions of the query API
161
+
162
+ _Coming soon..._
163
+
164
+ - Better support for localization: Some of the newer features of localization and querying based on it will be better supported in Query V3
165
+ - Support multi-level nested references: Query V3 will allow you to query, resolve, and return content that has nested references of other contents and symbols.
166
+
110
167
  ## Mitosis
111
168
 
112
169
  This SDK is generated by [Mitosis](https://github.com/BuilderIO/mitosis). To see the Mitosis source-code, go [here](https://github.com/BuilderIO/builder/tree/main/packages/sdks/src).