Twitter cards are included in the Core of Fork. If you want to extend your custom module with Twitter cards you can follow this small guide.
Twitter cards works with meta tags to read all the needed data. To enable those meta tags you have to use the setTwitterCard method in your action.
$this->header->setTwitterCard($this->record['title'], $this->record['meta_description'], $imgUrl);
The example above is taken from the Blog module. There are more configuration options that aren't used here. If you want to use more of them you can find them
in src/Frontend/Core/Header/Header.php
.
Note: Don't forget to revalidate your page after you changed the cardtype.