You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/content/1.index.md
+17-9
Original file line number
Diff line number
Diff line change
@@ -3,29 +3,37 @@ layout: fullscreen
3
3
hideFromSiteSearch: true
4
4
---
5
5
6
-
::info
7
-
#title
8
-
Looking for v2 docs?
9
-
#default
10
-
These docs are for projects using the Alokai SDK, if you're looking for our Nuxt 2 based solutions, please visit our [v2 docs](https://docs.alokai.com/v2).
11
-
::
12
-
13
6
# [Alokai Docs]{.text-4xl.mt-8.block}
14
7
15
8
16
9
Alokai is a Frontend-as-a-Service that provides several tools to help you build performant, scalable, and customizable eCommerce storefronts. From UI libraries and integrations, to deployment and monitoring, we can help you build the ideal headless commerce experience.
::card{title="Learn the concepts"icon="IconVsf"iconClass="text-primary-500":coloredIcon="false"class="mb-5"}
19
14
20
15
#description
21
-
Set up a new Alokai project or learn more about our architecture, project principles, and all of the ways that the Alokai ecosystem can help you build better storefronts.
16
+
Learn more about our architecture, project principles, and all of the ways that the Alokai ecosystem can help you build better storefronts.
22
17
23
18
#cta
24
19
:::docs-arrow-link{to="/general"}
25
20
Learn more
26
21
:::
27
22
::
28
23
24
+
#section-2
25
+
::card{title="Learn the tools"icon="IconVsf"iconClass="text-primary-500":coloredIcon="false"}
26
+
27
+
#description
28
+
Learn how to use Alokai hands on from our guides. This is the best place to start if you want to skip the theory and make yoru hands dirty.
Copy file name to clipboardexpand all lines: docs/content/cookbook/1.index.md
+2-6
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,5 @@ navigation:
6
6
7
7
# Cookbook
8
8
9
-
::grid{:columns="3"}
10
-
#section-1
11
-
:card{to="/cookbook/oss-deployment-guide"title="OSS Deployments"description="Deploy to a linux server"icon="typcn:arrow-up-outline"}
12
-
13
-
14
-
::
9
+
:card{to="/cookbook/handling-custom-occ-endpoint" title="Handling Custom OCC Endpoints" description="It is a common task to add support for a custom (non-standard) SAP OCC API endpoint not covered by the Alokai intergration.
10
+
This guide will show you how can do it using Alokai." icon="typcn:arrow-up-outline"}
It is a common task to add support for a custom (non-standard) SAP OCC API endpoint not covered by the Alokai intergration.
4
-
This guide will show you how can do it using Alokai.
4
+
There are two ways how you can do it:
5
5
6
-
## Prerequisites
6
+
1. Generate new API client based on OpenAPI (swagger) specification.
7
+
2. Add support for a custom endpoint manually.
7
8
8
-
Before we start make sure that you are familiar with [Adding New API Methods](https://docs.alokai.com/storefront/integration-and-setup/storefront-extension#adding-new-api-methods) guide. With that guide, you would be able to
9
+
## Generating new API client
10
+
11
+
Generation of new API client allows you to add support for all custom endpoints at once. You just run a script and all the endpoints will be added to the integration.
12
+
13
+
How to do this is described in the [Generated API guide](/integrations/sapcc/features/generated-api).
14
+
15
+
This should be your default approach, because it is the most scalable and maintainable way.
16
+
17
+
## Adding support for a custom endpoint manually
18
+
19
+
If you don't want or cannot generate a new API client, you can add support for a custom endpoint manually.
20
+
It boils down to adding a new API method to the middleware that calls the custom endpoint. This guide shows how to do it efficiently.
21
+
22
+
When to use this approach?
23
+
24
+
- When for some reason you cannot generate a new API client, e.g. OpenAPI specification is not available.
25
+
- When you are iterating fast both on the API and the front-end and you don't want to regenerate the API client for each change.
26
+
27
+
### Prerequisites
28
+
29
+
Before we start make sure that you are familiar with [Adding New API Methods](/unified-data-layer/integration-and-setup/creating-new-api-methods) guide. With that guide, you would be able to
9
30
communicate with OCC API but it would require manual retrieval of context parameters (baseSiteId, userId, language,
10
31
and currency) and preparation of authorization headers. Read on to see how to streamline that process.
11
32
12
-
## Communicating with OCC API effectively
33
+
###Communicating with OCC API effectively
13
34
14
35
OCC endpoints have a given structure
15
36
@@ -35,74 +56,69 @@ Here's where to find the parameters:
35
56
36
57
-`baseUrl` - is configured in .env file as `SAPCC_API_URI`. The api client already knows it and prepends each URL with it.
37
58
-`baseSiteId` - is defined in the middleware configuration. That configuration is exposed to api method via context.
38
-
-`userId` - can be found in the request cookies under [`AUTH_USER_COOKIE_NAME`](https://docs.alokai.com/integrations/sapcc/api/sapcc-api/AUTH_USER_COOKIE_NAME).
39
-
-`language` - can be found in the request cookies under [`VSF_LOCALE_COOKIE`](https://docs.alokai.com/storefront/features/internationalization/internatialization-support).
40
-
-`currency` - can be found in the request cookies under [`VSF_CURRENCY_COOKIE`](https://docs.alokai.com/storefront/features/internationalization/currency-switching).
41
-
- authorization token - can be found in the request cookies under [`AUTH_USER_TOKEN_COOKIE_NAME`](https://docs.alokai.com/integrations/sapcc/api/sapcc-api/AUTH_USER_TOKEN_COOKIE_NAME)
59
+
-`userId` - can be found in the request cookies under [`AUTH_USER_COOKIE_NAME`](/integrations/sapcc/api/sapcc-api/AUTH_USER_COOKIE_NAME).
60
+
-`language` - can be found in the request cookies under [`VSF_LOCALE_COOKIE`](/storefront/features/internationalization/internatialization-support).
61
+
-`currency` - can be found in the request cookies under [`VSF_CURRENCY_COOKIE`](/storefront/features/internationalization/currency-switching).
62
+
- authorization token - can be found in the request cookies under [`AUTH_USER_TOKEN_COOKIE_NAME`](/integrations/sapcc/api/sapcc-api/AUTH_USER_TOKEN_COOKIE_NAME)
42
63
43
64
You don't have to parse the cookies yourself. Alokai provides helper methods for that. Here’s a code example of how to do it:
Here's an example implementation of the product interest feature. This feature is available in OCC API, but not in the middleware and SDK integration.
113
+
Here's an example implementation of the product interest feature.
92
114
Let's add support for it.
93
115
94
-
First, you need to add a new API method in the middleware. (For simplicity, this guide shows how to do it in one file, but we recommend splitting it into multiple files to maintain cleaner code.)
116
+
First, you need to add a new API method in the middleware.
Copy file name to clipboardexpand all lines: docs/content/guides/1.index.md
+37-11
Original file line number
Diff line number
Diff line change
@@ -9,26 +9,52 @@ Welcome to the guides section of the documentation. Here you will find a collect
9
9
10
10
At **Alokai**, we are committed to providing the best possible experience for our users. We are constantly working on improving our documentation and adding new guides to help you get the most out of the platform.
11
11
12
-
## Getting Help
13
-
If you have any questions or need help with anything, please don't hesitate to get in touch with us in our [Discord](https://discord.vuestorefront.io/). We are always happy to help.
14
12
15
-
## Alokai Guides
16
13
14
+
## Learn Alokai
17
15
18
-
::grid{:columns='3'}
16
+
Follow this path to understand how to use Alokai and start building your Alokai application following performance best practices.
17
+
::steps
19
18
20
-
#section-1
21
-
:card{to="/guides/alokai-essentials"title="Alokai Essentials"description="Learn how to build Alokai Application: From 0 to Hero. Understand how different parts of our stack will help you to build your Alokai application."icon="tabler:123"}
Alokai is not a cookie-cutter solution, it is meant to be able to handle even the most complex use cases. This guide will take you through the most common customization scenarios.
29
+
::
22
30
23
-
#section-2
24
-
:card{to="/guides/performance"title="Performance"description="Improve your website's user experience and increase conversions by optimizing your website's performance."icon="gg:performance"}
Learn how to create efficient and unified multigeo/multibrand/multivendor setups with Alokai.
35
+
::
36
+
37
+
::
25
38
26
-
#section-3
27
-
:card{to="/guides/customization-next-js"title="Customization"description="Alokai is not a cookie-cutter solution, it is meant to be able to handle even the most complex use cases. This guide will take you through the most common customization scenarios."icon="tabler:tool"}
Learn how to implement health check endpoints for your Alokai Cloud applications running on Kubernetes. This guide covers liveness and readiness probes implementation to ensure proper application monitoring and reliability.
Every 100ms added to loading time costed Amazon 1% less sales. Don't let the poor performance to ruin your sales. Learn how to optimize your store for speed.
0 commit comments