> For the complete documentation index, see [llms.txt](https://docs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.akinon.com/technical-guides/project-zero/next.js/plugins/akifast.md).

# Akifast

**pz-akifast** is a Project Zero plugin that provides a fast checkout experience with customizable buttons for both checkout and quick login scenarios.

## <mark style="color:red;">**Installation Method**</mark>

You can use the following command to install the extension with the latest plugins:

```bash
npx @akinon/projectzero@latest --plugins
```

### <mark style="color:red;">**Setting the Visibility of Buttons**</mark>

To customize button visibility, update your `src/settings.js`:

{% hint style="warning" %}
All buttons are visible by default.
{% endhint %}

```javascript
module.exports = {
 // other settings
 plugins: {
   // other plugin settings
   'pz-akifast': {
     quickLogin: false,
     pdp: false,
     basket: false
   }
 }
};
```

### <mark style="color:red;">**Checkout Button Props**</mark>

<table><thead><tr><th width="114.10546875">Prop</th><th width="103.0078125">Type</th><th width="130.28515625">Required</th><th>Description</th></tr></thead><tbody><tr><td>isPdp</td><td>boolean</td><td>Optional</td><td>Indicates if it's a product info page.</td></tr><tr><td>renderer</td><td>object</td><td>Optional</td><td>Custom rendering functions.</td></tr></tbody></table>

### <mark style="color:red;">**Quick Login Props**</mark>

<table><thead><tr><th width="161.703125">Prop</th><th width="99.50390625">Type</th><th width="168.29296875">Required</th><th>Description</th></tr></thead><tbody><tr><td>buttonText</td><td>string</td><td>Optional</td><td>Text displayed on the button.</td></tr><tr><td>isCaptchaVisible</td><td>boolean</td><td>Required</td><td>Indicates if captcha is visible.</td></tr><tr><td>captchaValidated</td><td>boolean</td><td>Required</td><td>Indicates if captcha is validated.</td></tr><tr><td>renderer</td><td>object</td><td>QuickLoginButton</td><td>Custom rendering functions.</td></tr></tbody></table>

### <mark style="color:red;">**Renderer Props Types**</mark>

The `renderer` object allows you to fully customize the UI of both the checkout and quick login buttons:

```typescript
interface AkifastRendererProps {
 quickLoginButton?: {
   renderButton?: (props: {
     buttonText: string;
     disabled: boolean;
     onClick: () => void;
     rest: React.ButtonHTMLAttributes<HTMLButtonElement>;
   }) => React.ReactNode;
 };
 checkoutButton?: {
   renderButton?: (props: {
     provider: ProvidersType;
     rest: OneClickCheckoutButtonProps;
   }) => React.ReactNode;
   renderEmptyState?: () => React.ReactNode;
 };
}
```

## <mark style="color:red;">**Usage Examples**</mark>

Both the `CheckoutButton` and `QuickLoginButton` can be customized using the `renderer` prop. This allows you to fully customize the appearance and behavior of these components while maintaining their core functionality.

### <mark style="color:red;">**Checkout Button**</mark>

**Summary:**

```bash
/src/views/basket/summary.tsx
```

**Product Info:**

```bash
/src/views/product/product-info.tsx
```

#### **Default Usage**

```javascript
import PluginModule, { Component } from '@akinon/next/components/plugin-module';

<PluginModule
   component={Component.AkifastCheckoutButton}
   props={{
     ...checkoutProviderProps, // same with one click checkout props
     isPdp: true
   }}
/>;
```

#### **Customized Usage with Renderer**

```javascript
import PluginModule, { Component } from '@akinon/next/components/plugin-module';

<PluginModule
 component={Component.AkifastCheckoutButton}
 props={{
   isPdp: true,
   renderer: {
     renderButton: ({ provider, rest }) => (
       <div className="custom-checkout-wrapper">
         <button
           className="custom-checkout-button"
           onClick={() => {
             // Your custom logic
             console.log('Provider:', provider);
             // You can still pass through all original props
             console.log('Original props:', rest);
           }}
         >
           Hemen Satın Al
         </button>
       </div>
     ),
     renderEmptyState: () => (
       <div className="checkout-unavailable">
         Akifast ile ödeme şu an mevcut değil
       </div>
     )
   }
 }}
/>;

```

### <mark style="color:red;">**Quick Login Button**</mark>

```bash
/src/views/login/index.tsx
```

#### **Default Usage**

```javascript
import PluginModule, { Component } from '@akinon/next/components/plugin-module';

<PluginModule
   component={Component.AkifastQuickLoginButton}
   props={{
     isCaptchaVisible,
     captchaValidated
   }}
/>;
```

#### **Customized Usage with Renderer**

```javascript
import PluginModule, { Component } from '@akinon/next/components/plugin-module';

<PluginModule
 component={Component.AkifastQuickLoginButton}
 props={{
   isCaptchaVisible,
   captchaValidated,
   buttonText: 'Hızlı Giriş',
   renderer: {
     renderButton: ({ buttonText, disabled, onClick, rest }) => (
       <button
         className="custom-login-button"
         disabled={disabled}
         onClick={onClick}
         {...rest}
       >
         <svg className="icon-login" viewBox="0 0 24 24">
           {/* Your custom SVG icon */}
         </svg>
         {buttonText}
       </button>
     )
   }
 }}
/>;
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.akinon.com/technical-guides/project-zero/next.js/plugins/akifast.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
