PHPackages                             abduns/vcard - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. abduns/vcard

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

abduns/vcard
============

A framework-agnostic VCard 3.0/4.0 generator for PHP 8.2+.

v1.1.3(3w ago)012[1 PRs](https://github.com/abduns/vcard/pulls)1MITPHPPHP ^8.2CI passing

Since May 17Pushed 3w agoCompare

[ Source](https://github.com/abduns/vcard)[ Packagist](https://packagist.org/packages/abduns/vcard)[ RSS](/packages/abduns-vcard/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (3)Versions (9)Used By (1)

vcard
=====

[](#vcard)

A framework-agnostic VCard 3.0/4.0 generator for PHP 8.2+.

[![Tests](https://github.com/abduns/vcard/actions/workflows/tests.yml/badge.svg)](https://github.com/abduns/vcard/actions)[![Version](https://camo.githubusercontent.com/be57181dcf48f3b48b87c9cf3392d3186055c19344a300a6c5815e016c56a8d1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616264756e732f76636172642e737667)](https://packagist.org/packages/abduns/vcard)[![Downloads](https://camo.githubusercontent.com/1151a532d72d46e743e0d52f78aec11045f0e29dc6a46065adf10d7b2cc7dcd5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616264756e732f76636172642e737667)](https://packagist.org/packages/abduns/vcard)[![License](https://camo.githubusercontent.com/42d99888d39ecc3a5e598ddaebdb01ce05472e813da4152866c5ce427e65e0fc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616264756e732f76636172642e737667)](LICENSE.md)

---

Features
--------

[](#features)

- Modern PHP support
- Lightweight and fast
- Typed API
- Framework agnostic
- Standards-oriented (RFC 6350)
- All 50 IANA registered properties supported
- Zero external dependencies

---

Installation
------------

[](#installation)

```
composer require abduns/vcard
```

---

Quick Start
-----------

[](#quick-start)

```
use Dunn\VCard\VCard;

$vcf = VCard::make()
    ->addName('Doe', 'John')
    ->addEmail('john@example.com', 'work')
    ->addPhoneNumber('+62-812-3456-7890', 'cell')
    ->addUrl('https://johndoe.com')
    ->build();

echo $vcf;
```

Example output:

```
BEGIN:VCARD
VERSION:4.0
N:Doe;John;;;
FN:John Doe
EMAIL;TYPE=work:john@example.com
TEL;TYPE=cell:+62-812-3456-7890
URL;TYPE=work:https://johndoe.com
REV:20240101T000000Z
END:VCARD
```

---

Why This Package?
-----------------

[](#why-this-package)

- Existing solutions are outdated
- Missing modern PHP features
- Poor developer experience
- No standards compliance
- Too framework-coupled

This package focuses on simplicity, interoperability, and modern developer ergonomics. Most existing PHP vCard libraries use outdated binary encoding instead of `data:` URIs and aren't aligned with RFC 6350.

---

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

```
use Dunn\VCard\VCard;

VCard::make()->addName(
    lastName:   'Doe',
    firstName:  'John',
    additional: '',
    prefix:     'Dr.',
    suffix:     'Jr.'
)
->addEmail('john@example.com', 'work')
->addPhoneNumber('+62-812-3456-7890', 'cell');
```

### Advanced Usage

[](#advanced-usage)

```
// Embedded (raw base64 → automatically wrapped as data: URI)
->addPhoto($base64String, 'image/jpeg')

// Social Profiles
->addSocialProfile('https://github.com/johndoe', 'GitHub')

// UID (recommended for sync)
->addUid('urn:uuid:' . $uuid)

// Custom Properties
->addProperty('X-CUSTOM-FIELD', 'value')
```

### Configuration

[](#configuration)

```
// The only enforced requirement at runtime is FN (Formatted Name).
// OK — addName() sets FN automatically
VCard::make()->addName('Doe', 'John')->build();
```

---

Standards / Specifications
--------------------------

[](#standards--specifications)

Designed around official Internet standards and IANA registries.

- RFC 6350 (vCard 4.0)
- RFC 6474 (Birth/Death)
- RFC 6715 (Expertise/Hobby)
- RFC 8605 (CONTACT-URI)
- RFC 9554
- RFC 9555

References:

-

---

Supported Features
------------------

[](#supported-features)

FeatureSupportRFC 6350 Validation✅All IANA Properties✅Custom Properties✅---

Compatibility
-------------

[](#compatibility)

PlatformSupportedPHP 8.2+✅Apple Contacts✅Google Contacts✅---

Design Goals
------------

[](#design-goals)

- Developer experience first
- Predictable APIs
- Minimal dependencies
- Strong typing
- Extensibility
- Interoperability

---

Architecture
------------

[](#architecture)

- immutable objects
- fluent builder pattern
- strong typing on inputs

---

Performance
-----------

[](#performance)

OperationTimeBuild typical vCard&lt; 1ms---

Testing
-------

[](#testing)

```
composer test
```

---

Roadmap
-------

[](#roadmap)

- Validation API
- vCard parsing / reading
- jCard (JSON) support
- xCard (XML) support

---

Contributing
------------

[](#contributing)

Contributions, issues, and discussions are welcome.

---

Security
--------

[](#security)

If you discover security issues, please report them responsibly.

---

License
-------

[](#license)

MIT

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance95

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

6

Last Release

23d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/28977075?v=4)[Abdun](/maintainers/abduns)[@abduns](https://github.com/abduns)

---

Top Contributors

[![abduns](https://avatars.githubusercontent.com/u/28977075?v=4)](https://github.com/abduns "abduns (11 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (3 commits)")

---

Tags

vCardvcfcontact

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/abduns-vcard/health.svg)

```
[![Health](https://phpackages.com/badges/abduns-vcard/health.svg)](https://phpackages.com/packages/abduns-vcard)
```

###  Alternatives

[jeroendesloovere/vcard

This VCard PHP class can generate a vCard with some data. When using an iOS device it will export as a .ics file because iOS devices don't support the default .vcf files.

5233.8M14](/packages/jeroendesloovere-vcard)[astrotomic/laravel-vcard

A fluent builder class for vCard files.

5332.8k](/packages/astrotomic-laravel-vcard)[jeroendesloovere/vcard-bundle

This Symfony 2 bundle can generate vCards with lots of data. When using an &lt; iOS 7 device it will export as a .ics file because iOS devices don't support the default .vcf files.

1777.9k3](/packages/jeroendesloovere-vcard-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
