# @adriantombu/salesforce-convert-id

> This library converts a 15 character Salesforce ID to a 18 characters Salesforce ID

Latest version **1.0.4** (published 2023-07-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @adriantombu/salesforce-convert-id
pnpm add @adriantombu/salesforce-convert-id
yarn add @adriantombu/salesforce-convert-id
bun add @adriantombu/salesforce-convert-id
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2023-07-18 |
| First published | 2020-05-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Adrian Tombu |
| Maintainers | adriantombu |
| Keywords | salesforce, id, api, record, crm, conversion |

## Links

- npm: https://www.npmjs.com/package/@adriantombu/salesforce-convert-id
- Repository: https://github.com/adriantombu/packages.git#main
- Homepage: https://github.com/adriantombu/packages/tree/main#readme
- Issues: https://github.com/adriantombu/packages/issues
- npm.io page: https://npm.io/package/@adriantombu/salesforce-convert-id

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2023-07-18
- 1.0.3 — 2020-10-01
- 1.0.2 — 2020-05-23
- 1.0.1 — 2020-05-12
- 1.0.0 — 2020-05-12

## README

# Salesforce Convert ID

[![npm version](https://badge.fury.io/js/%40adriantombu%2Fsalesforce-convert-id.svg)](https://badge.fury.io/js/%40adriantombu%2Fsalesforce-convert-id) [![](https://img.shields.io/badge/Buy%20me%20a%20tree-%F0%9F%8C%B3-lightgreen)](https://offset.earth/adrian)

Before the [Salesforce API v2.5](https://help.salesforce.com/articleView?id=000324087&type=1&mode=1) we had both formats of ID lengths which can sometimes lead to some problems. This library aims to converts a 15 character Salesforce ID to a 18 characters Salesforce ID to address this issue.

### How to use it

- Install the library first with `yarn add @adriantombu/salesforce-convert-id`
- And then import it in your script

```
const { salesforceConvertId } = require('@adriantombu/salesforce-convert-id')

const smallId = 'a0i1t000002i0p0';
const longId = salesforceConvertId(smallId)

'a0i1t000002i0p0AAA'
```

In case of an invalid ID, we juste send it back with no warning as this is not the purpose of this library

```
const { salesforceConvertId } = require('@adriantombu/salesforce-convert-id')

const aWrongId = 'badid';
const longId = salesforceConvertId(aWrongId)

'badid'
```

### How to contribute

- Clone the repository `git clone git@github.com:adriantombu/salesforce-convert-id.git`
- Install the packages with `yarn install`
- Modify the `src/index.ts` file
- When everything's done, you can send a PR \o/

---
_Source: https://npm.io/package/@adriantombu/salesforce-convert-id · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
