Self-insertion
Self-insertion is a literary device in which the author writes themself into the story as a fictional character. Forms 
In art, the equivalent of self-insertion is the inserted self-portrait, where the artist includes a self-portrait in a painting of a narrative subject. This has been a common artistic device since at least the European Renaissance. Similar literary devices include a first-person narrator, an author surrogate, and a character somewhat based on the author, whether the author included it intentionally or not. Many characters have been described as unintentional self-insertions, implying that their author is unconsciously using them as an author surrogate. "X-insert" or "reader-insert" fiction has the reader appear as a character in the story; their name is substituted with "you" or "y/n" ("your name"). Mindy Kaling has been accused of using self-insertion in her movie roles. Criticism
Self-insertion has been criticised as a writing device as being unoriginal. Examples

Money by Martin Amis
 The Razor's Edge by Somerset Maugham
 Slaughterhouse-Five by Kurt Vonnegut
 Breakfast of Champions by Kurt Vonnegut
 The French Lieutenant's Woman by John Fowles
 Stan Lee in different Marvel comic books and movies
 Clive Cussler, author of Dirk Pitt novels, has inserted himself as a deus ex machina character in several of his books. Gargantua and Pantagruel by François Rabelais, in the chapter "How Pantagruel with his tongue covered a whole army, and what the author saw in his mouth"
 Milton: A Poem in Two Books by William Blake
 The Divine Comedy by Dante Alighieri
 Randolph Carter in H.P. Lovecraft tales
 The title character of the Rush Revere series by Rush Limbaugh
 Bella Swan in the Twilight novel series by Stephenie Meyer
 Rayford Steele and Buck Williams in the Left Behind novel series by Tim LaHaye and Jerry B. Jenkins
 The title character of Jane Eyre by Charlotte Bronte
 I am the Messenger by Markus Zusak
 Homestuck by Andrew Hussie
 JPod by Douglas Coupland
 The Dark Tower VI: Song of Susannah by Stephen King
 Handbook for Mortals by Lani Sarem
 A Series of Unfortunate Events by Lemony Snicket
 The Map and the Territory by Michel Houellebecq
 Frank Owen in The Ragged-Trousered Philanthropists by Robert Tressell
 Robert Langdon in the Robert Langdon book series by Dan Brown
 John Barth in the Dunyazadiad segment of John Barth's novel Chimera. Rohan Kishibe in Diamond Is Unbreakable by Hirohiko Araki
 Louis in the Wayside School series by Louis Sachar
 Rudyard Kipling in The Man Who Would Be King by Rudyard Kipling
 The Thin Clergyman in The Railway Series by The Rev. W. Awdry

See also
 Cameo appearance
 Self-parody
 Self-reference
 Mary Sue

References

Narratology