---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../modules.md) / [project-index](../index.md) / buildProjectIndex

# Function: buildProjectIndex()

> **buildProjectIndex**(`options`): [`ProjectIndex`](../interfaces/ProjectIndex.md)

Defined in: [packages/b2c-tooling-sdk/src/project-index/build.ts:115](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/project-index/build.ts#L115)

Builds a [ProjectIndex](../interfaces/ProjectIndex.md) from cartridges on disk: storefront endpoints
(SFRA routes composed along the cartridge path through server.extend,
append, prepend, and replace; SiteGenesis guard-based controllers;
pipeline start nodes), hook registrations, Custom API endpoints, and custom
job step types.

## Parameters

### options

[`BuildProjectIndexOptions`](../interfaces/BuildProjectIndexOptions.md) = `{}`

## Returns

[`ProjectIndex`](../interfaces/ProjectIndex.md)

## Example

```typescript
import {buildProjectIndex} from '@salesforce/b2c-tooling-sdk/project-index';

const index = buildProjectIndex({root: '.', cartridgePath: ['app_custom', 'app_storefront_base', 'modules']});
const unprotected = index.endpoints.filter((e) => e.csrf === 'none');
```
